summaryrefslogtreecommitdiff
path: root/chromium/third_party/ffmpeg
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 10:22:43 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:36:28 +0000
commit271a6c3487a14599023a9106329505597638d793 (patch)
treee040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/ffmpeg
parent7b2ffa587235a47d4094787d72f38102089f402a (diff)
downloadqtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/ffmpeg')
-rwxr-xr-xchromium/third_party/ffmpeg/BUILD.gn15
-rw-r--r--chromium/third_party/ffmpeg/CREDITS.chromium391
-rw-r--r--chromium/third_party/ffmpeg/Changelog11
-rw-r--r--chromium/third_party/ffmpeg/LICENSE.md11
-rw-r--r--chromium/third_party/ffmpeg/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/README.chromium2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.asm16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config.h20
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/config.h18
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.asm14
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/config.h16
-rw-r--r--chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h2
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/README57
-rw-r--r--chromium/third_party/ffmpeg/chromium/patches/config_flag_changes.txt25
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py3
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py26
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/generate_gn.py1
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py28
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/robo_branch.py60
-rw-r--r--chromium/third_party/ffmpeg/chromium/scripts/robo_lib.py5
-rwxr-xr-xchromium/third_party/ffmpeg/chromium/scripts/robosushi.py5
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h510
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avs/capi.h44
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avs/config.h17
-rw-r--r--chromium/third_party/ffmpeg/compat/avisynth/avs/types.h6
-rwxr-xr-xchromium/third_party/ffmpeg/compat/cuda/ptx2c.sh2
-rwxr-xr-xchromium/third_party/ffmpeg/compat/windows/makedef4
-rwxr-xr-xchromium/third_party/ffmpeg/configure57
-rw-r--r--chromium/third_party/ffmpeg/doc/APIchanges9
-rw-r--r--chromium/third_party/ffmpeg/doc/bitstream_filters.texi11
-rw-r--r--chromium/third_party/ffmpeg/doc/build_system.txt8
-rw-r--r--chromium/third_party/ffmpeg/doc/decoders.texi26
-rw-r--r--chromium/third_party/ffmpeg/doc/encoders.texi8
-rw-r--r--chromium/third_party/ffmpeg/doc/examples/avio_reading.c7
-rw-r--r--chromium/third_party/ffmpeg/doc/ffplay.texi2
-rw-r--r--chromium/third_party/ffmpeg/doc/ffprobe.xsd14
-rw-r--r--chromium/third_party/ffmpeg/doc/fftools-common-opts.texi9
-rw-r--r--chromium/third_party/ffmpeg/doc/filters.texi552
-rw-r--r--chromium/third_party/ffmpeg/doc/formats.texi22
-rw-r--r--chromium/third_party/ffmpeg/doc/general.texi35
-rw-r--r--chromium/third_party/ffmpeg/doc/indevs.texi18
-rw-r--r--chromium/third_party/ffmpeg/doc/muxers.texi96
-rw-r--r--chromium/third_party/ffmpeg/doc/scaler.texi28
-rw-r--r--chromium/third_party/ffmpeg/doc/writing_filters.txt2
-rw-r--r--chromium/third_party/ffmpeg/ffmpeg_generated.gni1
-rw-r--r--chromium/third_party/ffmpeg/fftools/ffmpeg.h2
-rw-r--r--chromium/third_party/ffmpeg/fftools/ffmpeg_hw.c15
-rw-r--r--chromium/third_party/ffmpeg/fftools/ffmpeg_opt.c6
-rw-r--r--chromium/third_party/ffmpeg/fftools/ffplay.c8
-rw-r--r--chromium/third_party/ffmpeg/fftools/ffprobe.c22
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/4xm.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/Makefile7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/a64multienc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacdec_template.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacenc_ltp.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ac3enc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/adpcm.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/agm.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/aic.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alac.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/allcodecs.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/alsdec.c35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/apedec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/arbc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plus.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/atrac9dec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/av1_metadata_bsf.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avcodec.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/avpacket.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bink.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/binkdsp.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bintext.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/bitstream.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs.h18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_av1.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_h264.h18
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_h2645.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_h264_syntax_template.c81
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_h265.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_h265_syntax_template.c132
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_jpeg.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.c72
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.h6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2_syntax_template.c89
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_vp9.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cbs_vp9_syntax_template.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cfhd.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cinepak.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cngdec.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/codec_desc.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cpia.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/cuviddec.c12
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/diracdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxtory.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/dxv.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/error_resilience.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffv1dec_template.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c19
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fic.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/filter_units_bsf.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fits.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fitsdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/flicvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/fmvc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gdv.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/gif.c14
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/golomb.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h263dec.c27
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c96
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_parse.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_ps.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_ps.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264_redundant_pps_bsf.c25
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h264dec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h265_metadata_bsf.c154
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h265_profile_level.c108
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/h265_profile_level.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_ps.c23
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevc_ps.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hevcdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/hq_hqa.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/iff.c17
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/ilbcdec.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/interplayvideo.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/jvdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libdav1d.c33
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libvpxenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx264.c62
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/libx265.c71
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/loco.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/m101.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/magicyuv.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mediacodecdec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mediacodecdec_common.c24
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/cabac.h2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mjpegdec.c460
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parse.c215
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parse.h (renamed from chromium/third_party/ffmpeg/libavcodec/mlp_parser.h)15
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlp_parser.c193
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mlpenc.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/motionpixels.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mpeg2_metadata_bsf.c50
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/mss4.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/nvenc.c31
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/omx.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/options.c169
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pafvideo.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pngenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/pnm_parser.c45
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/prosumer.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qdm2.c26
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qdmc.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsv.c63
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsv_internal.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvdec.c35
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qsvenc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/qtrle.c7
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/rv10.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/sanm.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/scpr.c10
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/scpr3.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/svq3.c36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff.c52
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tiff.h36
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truehd_core_bsf.c132
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/truemotion2.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/tta.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/utils.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210dec.c28
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v210dec.h1
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/v4l2_m2m_dec.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_encode.c95
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_encode.h30
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c6
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1_block.c34
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vc1dsp.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c41
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videodsp_template.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/videotoolboxenc.c176
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vmnc.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3.c775
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp3data.h9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp4data.h1186
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9.c2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9_metadata_bsf.c16
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9_raw_reorder_bsf.c11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/vp9_superframe_bsf.c4
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wavpackenc.c20
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wavpackenc.h11
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wcmv.c3
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/wmv2dec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/opusdsp.asm9
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c8
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/x86/v210.asm93
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/xpmdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavcodec/zmbv.c8
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/alsa.c6
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/avfoundation.m188
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_common.cpp16
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp7
-rw-r--r--chromium/third_party/ffmpeg/libavdevice/gdigrab.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/Makefile8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_adeclick.c143
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_afftfilt.c255
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_aiir.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_amultiply.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_anlmdn.c40
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_asoftclip.c288
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_asr.c181
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_astats.c113
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_atempo.c11
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_biquads.c74
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_crossfeed.c10
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_deesser.c244
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c96
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_rubberband.c78
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_sofalizer.c36
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_stereowiden.c10
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_superequalizer.c31
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/af_surround.c331
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/allfilters.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_abitscope.c33
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_ahistogram.c41
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c32
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c91
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showspatial.c372
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c297
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c32
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c35
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.c77
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.h8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.c141
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.h2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/dnn_interface.h16
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_ebur128.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_interleave.c137
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_loop.c21
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/f_realtime.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/framesync.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/gblur.h55
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/opencl.h38
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/opencl/nlmeans.cl115
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/opencl_source.h1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/qsvvpp.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/unsharp.h4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.c339
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.h8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/version.h5
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_blend.c210
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_chromakey.c8
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c84
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c110
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_colorspace.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c3
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_crop.c73
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_qsv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_vaapi.c39
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_derain.c212
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c56
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_freezedetect.c7
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_gblur.c129
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lensfun.c4
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut.c310
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut2.c55
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c75
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_maskedclamp.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_maskedmerge.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_midequalizer.c6
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_misc_vaapi.c56
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_mix.c9
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_nlmeans_opencl.c443
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_normalize.c17
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_ocr.c10
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_overlay_qsv.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_procamp_vaapi.c41
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_readeia608.c49
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale.c12
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale_cuda.c44
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale_qsv.c44
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_scale_vaapi.c112
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c46
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_sr.c189
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_stack.c20
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_tonemap.c39
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_transpose_vaapi.c51
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c102
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vibrance.c36
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vmafmotion.c1
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_vpp_qsv.c38
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/vf_xmedian.c351
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur.asm185
-rw-r--r--chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur_init.c40
-rw-r--r--chromium/third_party/ffmpeg/libavformat/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aacdec.c34
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aadec.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/allformats.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avc.c186
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avc.h15
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avidec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/aviobuf.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/avisynth.c36
-rw-r--r--chromium/third_party/ffmpeg/libavformat/cache.c17
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dashdec.c142
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dashenc.c31
-rw-r--r--chromium/third_party/ffmpeg/libavformat/dump.c8
-rw-r--r--chromium/third_party/ffmpeg/libavformat/flvenc.c27
-rw-r--r--chromium/third_party/ffmpeg/libavformat/gif.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hevc.c36
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hls.c37
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hlsenc.c267
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hlsplaylist.c11
-rw-r--r--chromium/third_party/ffmpeg/libavformat/hlsplaylist.h5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/http.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/icodec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/id3v2enc.c39
-rw-r--r--chromium/third_party/ffmpeg/libavformat/ifv.c307
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/img2dec.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/isom.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/jacosubdec.c9
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskadec.c381
-rw-r--r--chromium/third_party/ffmpeg/libavformat/matroskaenc.c327
-rw-r--r--chromium/third_party/ffmpeg/libavformat/microdvddec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mov.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/movenc.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mp3enc.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mpegts.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mux.c23
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxf.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfdec.c48
-rw-r--r--chromium/third_party/ffmpeg/libavformat/mxfenc.c213
-rw-r--r--chromium/third_party/ffmpeg/libavformat/nut.c1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/oggparseogm.c3
-rw-r--r--chromium/third_party/ffmpeg/libavformat/riff.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rpl.c86
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtsp.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/rtsp.h1
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sbgdec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/sccdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/segment.c41
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subfile.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subtitles.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/subtitles.h2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tiertexseq.c38
-rw-r--r--chromium/third_party/ffmpeg/libavformat/tls_gnutls.c12
-rw-r--r--chromium/third_party/ffmpeg/libavformat/utils.c25
-rw-r--r--chromium/third_party/ffmpeg/libavformat/version.h4
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vividas.c25
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vpk.c7
-rw-r--r--chromium/third_party/ffmpeg/libavformat/vqf.c5
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webm_chunk.c63
-rw-r--r--chromium/third_party/ffmpeg/libavformat/webvttdec.c10
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wsddec.c2
-rw-r--r--chromium/third_party/ffmpeg/libavformat/wtvdec.c5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/Makefile2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/avstring.c5
-rw-r--r--chromium/third_party/ffmpeg/libavutil/dynarray.h2
-rw-r--r--chromium/third_party/ffmpeg/libavutil/frame.h61
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hwcontext_qsv.c18
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hwcontext_vaapi.c137
-rw-r--r--chromium/third_party/ffmpeg/libavutil/hwcontext_vdpau.c18
-rw-r--r--chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h42
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixdesc.c24
-rw-r--r--chromium/third_party/ffmpeg/libavutil/pixfmt.h3
-rw-r--r--chromium/third_party/ffmpeg/libavutil/time_internal.h6
-rw-r--r--chromium/third_party/ffmpeg/libavutil/tx.c803
-rw-r--r--chromium/third_party/ffmpeg/libavutil/tx.h81
-rw-r--r--chromium/third_party/ffmpeg/libavutil/version.h2
-rw-r--r--chromium/third_party/ffmpeg/libswresample/swresample.c8
-rw-r--r--chromium/third_party/ffmpeg/libswscale/input.c2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/output.c6
-rw-r--r--chromium/third_party/ffmpeg/libswscale/ppc/swscale_altivec.c3
-rw-r--r--chromium/third_party/ffmpeg/libswscale/ppc/swscale_vsx.c449
-rw-r--r--chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c51
-rw-r--r--chromium/third_party/ffmpeg/libswscale/utils.c2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/version.h2
-rw-r--r--chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c4
-rw-r--r--chromium/third_party/ffmpeg/tools/Makefile3
-rw-r--r--chromium/third_party/ffmpeg/tools/crypto_bench.c10
-rw-r--r--chromium/third_party/ffmpeg/tools/python/convert.py52
-rw-r--r--chromium/third_party/ffmpeg/tools/python/convert_from_tensorflow.py201
-rw-r--r--chromium/third_party/ffmpeg/tools/target_dec_fuzzer.c19
-rw-r--r--chromium/third_party/ffmpeg/tools/target_dem_fuzzer.c163
508 files changed, 16615 insertions, 5008 deletions
diff --git a/chromium/third_party/ffmpeg/BUILD.gn b/chromium/third_party/ffmpeg/BUILD.gn
index 1f11a9731de..85a5338e556 100755
--- a/chromium/third_party/ffmpeg/BUILD.gn
+++ b/chromium/third_party/ffmpeg/BUILD.gn
@@ -278,18 +278,23 @@ target(link_target_type, "ffmpeg_internal") {
}
}
- if (is_fuchsia || (is_posix && !(is_android && use_call_graph))) {
- # Remove default stack frames config so we can force -fomit-frame-pointer.
- configs -= [ "//build/config/compiler:default_stack_frames" ]
-
+ if (is_fuchsia || is_posix) {
cflags += [
"-fPIC",
- "-fomit-frame-pointer",
# ffmpeg uses its own deprecated functions.
"-Wno-deprecated-declarations",
]
+ if (!(is_android && use_call_graph)) {
+ # Remove default stack frames config so we can force -fomit-frame-pointer.
+ configs -= [ "//build/config/compiler:default_stack_frames" ]
+
+ cflags += [
+ "-fomit-frame-pointer",
+ ]
+ }
+
if (!is_clang) {
# gcc doesn't have flags for specific warnings, so disable them
# all.
diff --git a/chromium/third_party/ffmpeg/CREDITS.chromium b/chromium/third_party/ffmpeg/CREDITS.chromium
index c028d69e0d2..bdd1b530115 100644
--- a/chromium/third_party/ffmpeg/CREDITS.chromium
+++ b/chromium/third_party/ffmpeg/CREDITS.chromium
@@ -103,22 +103,41 @@ license version needs to be upgraded by passing `--enable-version3` to configure
There are certain libraries you can combine with FFmpeg whose licenses are not
compatible with the GPL and/or the LGPL. If you wish to enable these
libraries, even in circumstances that their license may be incompatible, pass
-`--enable-nonfree` to configure. But note that if you enable any of these
-libraries the resulting binary will be under a complex license mix that is
-more restrictive than the LGPL and that may result in additional obligations.
-It is possible that these restrictions cause the resulting binary to be
+`--enable-nonfree` to configure. This will cause the resulting binary to be
unredistributable.
The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are
incompatible with the GPLv2 and v3. To the best of our knowledge, they are
compatible with the LGPL.
-The NVENC library, while its header file is licensed under the compatible MIT
-license, requires a proprietary binary blob at run time, and is deemed to be
-incompatible with the GPL. We are not certain if it is compatible with the
-LGPL, but we require `--enable-nonfree` even with LGPL configurations in case
-it is not.
+********************************************************************************
+
+libavcodec/arm/jrevdct_arm.S
+
+C-like prototype :
+ void j_rev_dct_arm(DCTBLOCK data)
+
+ With DCTBLOCK being a pointer to an array of 64 'signed shorts'
+
+ Copyright (c) 2001 Lionel Ulmer (lionel.ulmer@free.fr / bbrox@bbrox.org)
+
+ 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
+ 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.
********************************************************************************
@@ -178,152 +197,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************
-libavutil/avsscanf.c
-
-Copyright (c) 2005-2014 Rich Felker, et al.
-
-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.
-
-********************************************************************************
-
-libavcodec/x86/xvididct.asm
-
-XVID MPEG-4 VIDEO CODEC
-
- Conversion from gcc syntax to x264asm syntax with modifications
- by Christophe Gisquet <christophe.gisquet@gmail.com>
-
- =========== SSE2 inverse discrete cosine transform ===========
-
- Copyright(C) 2003 Pascal Massimino <skal@planet-d.net>
-
- Conversion to gcc syntax with modifications
- by Alexander Strange <astrange@ithinksw.com>
-
- Originally from dct/x86_asm/fdct_sse2_skal.asm in Xvid.
-
- Vertical pass is an implementation of the scheme:
- Loeffler C., Ligtenberg A., and Moschytz C.S.:
- Practical Fast 1D DCT Algorithm with Eleven Multiplications,
- Proc. ICASSP 1989, 988-991.
-
- Horizontal pass is a double 4x4 vector/matrix multiplication,
- (see also Intel's Application Note 922:
- http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
- Copyright (C) 1999 Intel Corporation)
-
- More details at http://skal.planet-d.net/coding/dct.html
-
- ======= MMX and XMM forward discrete cosine transform =======
-
- Copyright(C) 2001 Peter Ross <pross@xvid.org>
-
- Originally provided by Intel at AP-922
- http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
- (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
- but in a limited edition.
- New macro implements a column part for precise iDCT
- The routine precision now satisfies IEEE standard 1180-1990.
-
- Copyright(C) 2000-2001 Peter Gubanov <peter@elecard.net.ru>
- Rounding trick Copyright(C) 2000 Michel Lespinasse <walken@zoy.org>
-
- http://www.elecard.com/peter/idct.html
- http://www.linuxvideo.org/mpeg2dec/
-
- These examples contain code fragments for first stage iDCT 8x8
- (for rows) and first stage DCT 8x8 (for columns)
-
- conversion to gcc syntax by 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
-
-********************************************************************************
-
-libavcodec/arm/jrevdct_arm.S
-
-C-like prototype :
- void j_rev_dct_arm(DCTBLOCK data)
-
- With DCTBLOCK being a pointer to an array of 64 'signed shorts'
-
- Copyright (c) 2001 Lionel Ulmer (lionel.ulmer@free.fr / bbrox@bbrox.org)
-
- 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
- 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.
-
-********************************************************************************
-
-libswresample/version.h
-
-Version macros.
-
-This file is part of libswresample
-
-libswresample 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.
-
-libswresample 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 libswresample; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-********************************************************************************
-
-libavcodec/mips/amrwbdec_mips.c
+libavcodec/mips/acelp_filters_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -354,6 +228,8 @@ SUCH DAMAGE.
Author: Nedeljko Babic (nbabic@mips.com)
+various filters for ACELP-based codecs optimized for MIPS
+
This file is part of FFmpeg.
FFmpeg is free software; you can redistribute it and/or
@@ -372,7 +248,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavcodec/mips/celp_math_mips.c
+libavcodec/mips/acelp_vectors_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -403,7 +279,8 @@ SUCH DAMAGE.
Author: Nedeljko Babic (nbabic@mips.com)
-Math operations optimized for MIPS
+adaptive and fixed codebook vector operations for ACELP-based codecs
+optimized for MIPS
This file is part of FFmpeg.
@@ -423,33 +300,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavformat/oggparsetheora.c
-
-Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi
-
-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.
-
-********************************************************************************
-
-libavcodec/mips/fft_mips.c
+libavcodec/mips/amrwbdec_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -478,10 +329,7 @@ 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)
-Author: Zoran Lukic (zoranl@mips.com)
-
-Optimized MDCT/IMDCT and FFT transforms
+Author: Nedeljko Babic (nbabic@mips.com)
This file is part of FFmpeg.
@@ -501,7 +349,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavcodec/mips/acelp_filters_mips.c
+libavcodec/mips/celp_filters_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -532,7 +380,7 @@ SUCH DAMAGE.
Author: Nedeljko Babic (nbabic@mips.com)
-various filters for ACELP-based codecs optimized for MIPS
+various filters for CELP-based codecs optimized for MIPS
This file is part of FFmpeg.
@@ -552,7 +400,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavcodec/mips/mpegaudiodsp_mips_float.c
+libavcodec/mips/celp_math_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -581,9 +429,9 @@ 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: Bojan Zivkovic (bojan@mips.com)
+Author: Nedeljko Babic (nbabic@mips.com)
-MPEG Audio decoder optimized for MIPS floating-point architecture
+Math operations optimized for MIPS
This file is part of FFmpeg.
@@ -603,7 +451,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavcodec/mips/acelp_vectors_mips.c
+libavcodec/mips/fft_mips.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -632,10 +480,10 @@ 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)
+Author: Stanislav Ocovaj (socovaj@mips.com)
+Author: Zoran Lukic (zoranl@mips.com)
-adaptive and fixed codebook vector operations for ACELP-based codecs
-optimized for MIPS
+Optimized MDCT/IMDCT and FFT transforms
This file is part of FFmpeg.
@@ -655,7 +503,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
-libavcodec/mips/celp_filters_mips.c
+libavcodec/mips/mpegaudiodsp_mips_float.c
Copyright (c) 2012
MIPS Technologies, Inc., California.
@@ -684,9 +532,9 @@ 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)
+Author: Bojan Zivkovic (bojan@mips.com)
-various filters for CELP-based codecs optimized for MIPS
+MPEG Audio decoder optimized for MIPS floating-point architecture
This file is part of FFmpeg.
@@ -706,6 +554,127 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
+libavcodec/x86/xvididct.asm
+
+XVID MPEG-4 VIDEO CODEC
+
+ Conversion from gcc syntax to x264asm syntax with modifications
+ by Christophe Gisquet <christophe.gisquet@gmail.com>
+
+ =========== SSE2 inverse discrete cosine transform ===========
+
+ Copyright(C) 2003 Pascal Massimino <skal@planet-d.net>
+
+ Conversion to gcc syntax with modifications
+ by Alexander Strange <astrange@ithinksw.com>
+
+ Originally from dct/x86_asm/fdct_sse2_skal.asm in Xvid.
+
+ Vertical pass is an implementation of the scheme:
+ Loeffler C., Ligtenberg A., and Moschytz C.S.:
+ Practical Fast 1D DCT Algorithm with Eleven Multiplications,
+ Proc. ICASSP 1989, 988-991.
+
+ Horizontal pass is a double 4x4 vector/matrix multiplication,
+ (see also Intel's Application Note 922:
+ http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
+ Copyright (C) 1999 Intel Corporation)
+
+ More details at http://skal.planet-d.net/coding/dct.html
+
+ ======= MMX and XMM forward discrete cosine transform =======
+
+ Copyright(C) 2001 Peter Ross <pross@xvid.org>
+
+ Originally provided by Intel at AP-922
+ http://developer.intel.com/vtune/cbts/strmsimd/922down.htm
+ (See more app notes at http://developer.intel.com/vtune/cbts/strmsimd/appnotes.htm)
+ but in a limited edition.
+ New macro implements a column part for precise iDCT
+ The routine precision now satisfies IEEE standard 1180-1990.
+
+ Copyright(C) 2000-2001 Peter Gubanov <peter@elecard.net.ru>
+ Rounding trick Copyright(C) 2000 Michel Lespinasse <walken@zoy.org>
+
+ http://www.elecard.com/peter/idct.html
+ http://www.linuxvideo.org/mpeg2dec/
+
+ These examples contain code fragments for first stage iDCT 8x8
+ (for rows) and first stage DCT 8x8 (for columns)
+
+ conversion to gcc syntax by 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
+
+********************************************************************************
+
+libavformat/oggparsetheora.c
+
+Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi
+
+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.
+
+********************************************************************************
+
+libavutil/avsscanf.c
+
+Copyright (c) 2005-2014 Rich Felker, et al.
+
+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.
+
+********************************************************************************
+
libswresample/swresample.h
Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
@@ -728,6 +697,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
********************************************************************************
+libswresample/version.h
+
+Version macros.
+
+This file is part of libswresample
+
+libswresample 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.
+
+libswresample 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 libswresample; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+********************************************************************************
+
libavcodec/jfdctfst.c
libavcodec/jfdctint_template.c
libavcodec/jrevdct.c
diff --git a/chromium/third_party/ffmpeg/Changelog b/chromium/third_party/ffmpeg/Changelog
index 1b4a9fac41d..c22d16c0f48 100644
--- a/chromium/third_party/ffmpeg/Changelog
+++ b/chromium/third_party/ffmpeg/Changelog
@@ -25,6 +25,17 @@ version <next>:
- AV1 frame split bitstream filter
- lscr decoder
- lagfun filter
+- asoftclip filter
+- Support decoding of HEVC 4:4:4 content in vdpau
+- colorhold filter
+- xmedian filter
+- asr filter
+- showspatial multimedia filter
+- VP4 video decoder
+- IFV demuxer
+- derain filter
+- deesser filter
+- mov muxer writes tracks with unspecified language instead of English by default
version 4.1:
diff --git a/chromium/third_party/ffmpeg/LICENSE.md b/chromium/third_party/ffmpeg/LICENSE.md
index ba65b059c5b..c7d6bf7121d 100644
--- a/chromium/third_party/ffmpeg/LICENSE.md
+++ b/chromium/third_party/ffmpeg/LICENSE.md
@@ -103,18 +103,9 @@ license version needs to be upgraded by passing `--enable-version3` to configure
There are certain libraries you can combine with FFmpeg whose licenses are not
compatible with the GPL and/or the LGPL. If you wish to enable these
libraries, even in circumstances that their license may be incompatible, pass
-`--enable-nonfree` to configure. But note that if you enable any of these
-libraries the resulting binary will be under a complex license mix that is
-more restrictive than the LGPL and that may result in additional obligations.
-It is possible that these restrictions cause the resulting binary to be
+`--enable-nonfree` to configure. This will cause the resulting binary to be
unredistributable.
The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are
incompatible with the GPLv2 and v3. To the best of our knowledge, they are
compatible with the LGPL.
-
-The NVENC library, while its header file is licensed under the compatible MIT
-license, requires a proprietary binary blob at run time, and is deemed to be
-incompatible with the GPL. We are not certain if it is compatible with the
-LGPL, but we require `--enable-nonfree` even with LGPL configurations in case
-it is not.
diff --git a/chromium/third_party/ffmpeg/Makefile b/chromium/third_party/ffmpeg/Makefile
index 48c59733b83..532372c9c46 100644
--- a/chromium/third_party/ffmpeg/Makefile
+++ b/chromium/third_party/ffmpeg/Makefile
@@ -50,6 +50,9 @@ $(TOOLS): %$(EXESUF): %.o
target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
+tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
+ $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH)
+
tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)
diff --git a/chromium/third_party/ffmpeg/README.chromium b/chromium/third_party/ffmpeg/README.chromium
index c7737142b65..80582b72bdc 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: CREDITS.chromium
Upstream Git: git://source.ffmpeg.org/ffmpeg.git
-Last Upstream Merge: a899b3b3c5f55e6c527f8aa81dbe15edb9fab63f, Feb 21 2019
+Last Upstream Merge: 81d3d7dd44acc7ae7c57e99176d1d428fb40c353, Jul 12 2019
This file documents the layout of the Chromium copy of FFmpeg, some common
tasks, and how to create the build files and related configurations.
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h
index fe209918b47..2c9c6fc7c70 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-arm --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi' --extra-ldflags='--target=arm-linux-androideabi' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-arm --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi' --extra-ldflags='--target=arm-linux-androideabi' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm-neon/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h
index 7f2c50477d8..db6831fb7bd 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-arm64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android' --extra-ldflags='--target=aarch64-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-arm64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android' --extra-ldflags='--target=aarch64-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h
index 7b31ae5f409..a513589c58f 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-x86 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android' --extra-ldflags='--target=i686-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-x86 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android' --extra-ldflags='--target=i686-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/config.h
index e955d1030b5..703dbe1c468 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-mips64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/mips64el-linux-android --extra-cflags='--target=mips64el-linux-android' --extra-ldflags='--target=mips64el-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-mips64r6 --extra-cflags='-mcpu=mips64r6' --disable-mips64r2 --enable-msa --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-mips64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/mips64el-linux-android --extra-cflags='--target=mips64el-linux-android' --extra-ldflags='--target=mips64el-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-mips64r6 --extra-cflags='-mcpu=mips64r6' --disable-mips64r2 --enable-msa --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 1
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mips64el/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h
index be3e0fa9fb3..5cf481e5112 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-mips --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/mipsel-linux-android --extra-cflags='--target=mipsel-linux-android' --extra-ldflags='--target=mipsel-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-mips --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/mipsel-linux-android --extra-cflags='--target=mipsel-linux-android' --extra-ldflags='--target=mipsel-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/mipsel/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm
index 58fcca6bb67..0e5ffd4b27c 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.asm
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h
index 7686a75810c..005cfda6494 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-x86_64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android' --extra-ldflags='--target=x86_64-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-x86_64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android' --extra-ldflags='--target=x86_64-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-demuxer=aac --enable-parser=aac --enable-decoder=aac" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/android/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h
index f0fedc087e5..c142381c12f 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux-noasm/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 fd7f464b35e..0ff88312ff9 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm-neon/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 c18dc573484..38ad8e67919 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h
index 33943767935..2b9c3666335 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 935ec9e9fb6..8b79a515b9b 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 2e53dd1e412..f1e466f697c 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/config.h
index 2e517a6668e..e58a813280a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mips64el/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 1bd05e000e4..983a4fc5cef 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/mipsel/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 cb825f8ad88..0bdaad93876 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 1
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 7b2827efd22..22aa9bb6bff 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/linux/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 1a8d6c5abac..a56597e0694 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 13bb7e86b0c..cd97c8fcca8 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=i686-apple-darwin-macho' --extra-cflags=-F/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/ --extra-ldflags=-syslibroot --extra-ldflags=/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk --extra-ldflags=-L/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=i686-apple-darwin-macho' --extra-cflags=-F/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/ --extra-ldflags=-syslibroot --extra-ldflags=/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk --extra-ldflags=-L/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64 --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/mac/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h
index 35919dbe53d..0c20c44233e 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/config.h
@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-ldflags='--target=arm64-windows' --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-ldflags='--target=arm64-windows' --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/arm64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 b468b3b24be..e0930008451 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 1b93f6ca464..8ea687b6464 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,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/x86' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/x86' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 4aaed46f644..4bc2501bcf0 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 9ff6479fe74..2cf4508cebd 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,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/x64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/x64' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chrome/win/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h
index cb467f3246a..7339bb17616 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux-noasm/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 ab897517999..c6f0a53e8c2 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm-neon/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 d3ad1558913..855a6235301 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h
index 3258b01974e..38ad6faf376 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 e3b975bcdcc..9ca04eed669 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 7de59556541..afbe037013a 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/config.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/config.h
index 9341cbc449b..7aa1002ef89 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mips64el/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 ea68cf84dd6..a0f7e278faa 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/mipsel/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 a8da91e2f41..a1bcd4f9dcd 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 1
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 b3be3067a7b..637f844ff02 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld' --enable-decoder='aac,h264' --enable-demuxer=aac --enable-parser='aac,h264' --enable-decoder=mpeg4 --enable-parser='h263,mpeg4video' --enable-demuxer=avi --enable-demuxer=amr --enable-decoder='amrnb,amrwb' --enable-decoder=gsm_ms --enable-parser=gsm" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/ChromeOS/linux/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h
index 79211ae0a18..4039dd1b63a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-arm --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi' --extra-ldflags='--target=arm-linux-androideabi' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-arm --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/arm-linux-androideabi --extra-cflags='--target=arm-linux-androideabi' --extra-ldflags='--target=arm-linux-androideabi' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-neon --extra-cflags='-mtune=generic-armv7-a' --extra-cflags='-mfloat-abi=softfp' --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm-neon/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h
index a64110657e5..c5aa07dbb2b 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-arm64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android' --extra-ldflags='--target=aarch64-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-arm64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/aarch64-linux-android --extra-cflags='--target=aarch64-linux-android' --extra-ldflags='--target=aarch64-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h
index 8cc4f4f7e00..a75e6378977 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-x86 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android' --extra-ldflags='--target=i686-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-x86 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/i686-linux-android --extra-cflags='--target=i686-linux-android' --extra-ldflags='--target=i686-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/x86-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --disable-x86asm --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/config.h
index 1758be3a253..d9516df5752 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-mips64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/mips64el-linux-android --extra-cflags='--target=mips64el-linux-android' --extra-ldflags='--target=mips64el-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-mips64r6 --extra-cflags='-mcpu=mips64r6' --disable-mips64r2 --enable-msa --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-mips64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/mips64el-linux-android --extra-cflags='--target=mips64el-linux-android' --extra-ldflags='--target=mips64el-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/mips64el-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-mips64r6 --extra-cflags='-mcpu=mips64r6' --disable-mips64r2 --enable-msa --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 1
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mips64el/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h
index 89dabdf81d4..45c5f2e733f 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-16/arch-mips --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/mipsel-linux-android --extra-cflags='--target=mipsel-linux-android' --extra-ldflags='--target=mipsel-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-16/arch-mips --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/mipsel-linux-android --extra-cflags='--target=mipsel-linux-android' --extra-ldflags='--target=mipsel-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/mipsel-linux-android-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/mipsel/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm
index af622fbc4ad..25ce7b5d78f 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.asm
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 0
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h
index 65a76e5425f..2dceb5cb80a 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/hdd1/workspace/chrome2/src/third_party/android_ndk/platforms/android-21/arch-x86_64 --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/android_ndk/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android' --extra-ldflags='--target=x86_64-linux-android' --extra-ldflags='--gcc-toolchain=/hdd1/workspace/chrome2/src/third_party/android_ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --enable-small --enable-cross-compile --sysroot=/ssd/trunk_blink_tot/src/third_party/android_ndk/platforms/android-21/arch-x86_64 --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/android_ndk/sysroot/usr/include/x86_64-linux-android --extra-cflags='--target=x86_64-linux-android' --extra-ldflags='--target=x86_64-linux-android' --extra-ldflags='--gcc-toolchain=/ssd/trunk_blink_tot/src/third_party/android_ndk/toolchains/x86_64-4.9/prebuilt/linux-x86_64/' --target-os=android --arch=x86_64 --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 0
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/android/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h
index e1a8287206e..3a59364dae8 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --disable-asm --disable-inline-asm --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux-noasm/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 254ee3d4f74..b60b67b28a0 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --enable-neon --extra-cflags='-mfpu=neon' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm-neon/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 93b06f4221f..1c500efc9b8 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=arm --enable-armv6 --enable-armv6t2 --enable-vfp --enable-thumb --extra-cflags='-march=armv7-a' --enable-cross-compile --target-os=linux --extra-cflags='--target=arm-linux-gnueabihf' --extra-ldflags='--target=arm-linux-gnueabihf' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm-sysroot --extra-cflags='-mtune=cortex-a8' --extra-cflags='-mfloat-abi=hard' --extra-cflags=-O2 --disable-neon --extra-cflags='-mfpu=vfpv3-d16' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h
index 42c3a68bac7..8c5cb1faa4f 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-cross-compile --cross-prefix=/usr/bin/aarch64-linux-gnu- --target-os=linux --extra-cflags='--target=aarch64-linux-gnu' --extra-ldflags='--target=aarch64-linux-gnu' --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_arm64-sysroot --arch=aarch64 --enable-armv8 --extra-cflags='-march=armv8-a' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 48970128b7f..45fa3ad122f 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 c9ae255c515..182218c085b 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=i686 --extra-cflags='\"-m32\"' --extra-ldflags='\"-m32\"' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/config.h
index 42a591a654e..2f122ba24e4 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mips64el --enable-mipsfpu --disable-mipsdsp --disable-mipsdspr2 --extra-cflags='-march=mips64el' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips64el-sysroot --enable-mips64r2 --disable-mips64r6 --disable-msa --extra-cflags='-mcpu=mips64r2' --extra-cflags='--target=mips64el-linux-gnuabi64' --extra-ldflags='--target=mips64el-linux-gnuabi64' --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mips64el/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 c35ac930d2e..6183b32e324 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/hdd1/workspace/chrome2/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --arch=mipsel --disable-mips32r6 --disable-mips32r5 --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-mipsfpu --extra-cflags='-march=mipsel' --extra-cflags='-mcpu=mips32' --extra-ldflags='-z notext' --enable-cross-compile --target-os=linux --sysroot=/ssd/trunk_blink_tot/src/build/linux/debian_sid_mips-sysroot --extra-cflags='--target=mipsel-linux-gnu' --extra-ldflags='--target=mipsel-linux-gnu' --enable-pic --cc=clang --cxx=clang++ --ld=clang" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/mipsel/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 9babedcd223..96d4961b0a8 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -215,7 +218,7 @@
%define HAVE_TERMIOS_H 1
%define HAVE_UDPLITE_H 0
%define HAVE_UNISTD_H 1
-%define HAVE_VALGRIND_VALGRIND_H 1
+%define HAVE_VALGRIND_VALGRIND_H 0
%define HAVE_WINDOWS_H 0
%define HAVE_WINSOCK2_H 0
%define HAVE_INTRINSICS_NEON 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 1
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 5db3bb63385..aaf64f2802c 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,12 +1,12 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-lto --enable-pic --cc=clang --cxx=clang++ --ld=clang --extra-ldflags='-fuse-ld=lld'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX ""
#define EXTERN_ASM
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -230,7 +233,7 @@
#define HAVE_TERMIOS_H 1
#define HAVE_UDPLITE_H 0
#define HAVE_UNISTD_H 1
-#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 1 -- forced to 0. See https://crbug.com/590440 */
+#define HAVE_VALGRIND_VALGRIND_H 0 /* #define HAVE_VALGRIND_VALGRIND_H 0 -- forced to 0. See https://crbug.com/590440 */
#define HAVE_WINDOWS_H 0
#define HAVE_WINSOCK2_H 0
#define HAVE_INTRINSICS_NEON 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 1
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/linux/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 10ed0688df7..cc70f586256 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 7b6ea530e85..ef51edc433d 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-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=i686-apple-darwin-macho' --extra-cflags=-F/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 --extra-cflags=-isystem/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/ --extra-ldflags=-syslibroot --extra-ldflags=/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk --extra-ldflags=-L/hdd1/workspace/chrome2/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --enable-pic --cc=clang --cxx=clang++ --ld=clang --enable-cross-compile --cc=clang --ld=ld64.lld --nm=llvm-nm --ar=llvm-ar --target-os=darwin --extra-cflags='--target=i686-apple-darwin-macho' --extra-cflags=-F/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks --extra-cflags='-mmacosx-version-min=10.10' --extra-cflags=-fblocks --extra-cflags=-nostdinc --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 --extra-cflags=-isystem/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include/ --extra-ldflags=-syslibroot --extra-ldflags=/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk --extra-ldflags=-L/ssd/trunk_blink_tot/src/build/win_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib --extra-ldflags=-lSystem --extra-ldflags=-macosx_version_min --extra-ldflags=10.10 --extra-ldflags=-sdk_version --extra-ldflags=10.10 --arch=x86_64 --extra-cflags=-m64 --extra-ldflags=-m64" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
#define AVCONV_DATADIR "/usr/local/share/ffmpeg"
-#define CC_IDENT "clang version 9.0.0 (trunk 357692)"
+#define CC_IDENT "clang version 9.0.0 (https://github.com/llvm/llvm-project/ f7e52fbdb5a7af8ea0808e98458b497125a5eca1)"
#define av_restrict restrict
#define EXTERN_PREFIX "_"
#define EXTERN_ASM _
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/mac/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h
index d0491d0952a..021557cd49e 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/config.h
@@ -1,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-ldflags='--target=arm64-windows' --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/arm64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/arm64'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --arch=aarch64 --as=clang-cl --extra-cflags='--target=arm64-windows' --extra-ldflags='--target=arm64-windows' --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/arm64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/arm64'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/arm64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 dbdd1a6aac3..c0eff60dfad 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 2ae08958574..1e1f6191c92 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,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/x86' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/x86'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-m32 --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/x86' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/x86'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/ia32/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_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 a7c72064535..325070c3f5a 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
@@ -65,6 +65,7 @@
%define HAVE_MIPSDSP 0
%define HAVE_MIPSDSPR2 0
%define HAVE_MSA 0
+%define HAVE_MSA2 0
%define HAVE_LOONGSON2 0
%define HAVE_LOONGSON3 0
%define HAVE_MMI 0
@@ -110,6 +111,7 @@
%define HAVE_MIPSDSP_EXTERNAL 0
%define HAVE_MIPSDSPR2_EXTERNAL 0
%define HAVE_MSA_EXTERNAL 0
+%define HAVE_MSA2_EXTERNAL 0
%define HAVE_LOONGSON2_EXTERNAL 0
%define HAVE_LOONGSON3_EXTERNAL 0
%define HAVE_MMI_EXTERNAL 0
@@ -155,6 +157,7 @@
%define HAVE_MIPSDSP_INLINE 0
%define HAVE_MIPSDSPR2_INLINE 0
%define HAVE_MSA_INLINE 0
+%define HAVE_MSA2_INLINE 0
%define HAVE_LOONGSON2_INLINE 0
%define HAVE_LOONGSON3_INLINE 0
%define HAVE_MMI_INLINE 0
@@ -474,6 +477,7 @@
%define CONFIG_MEDIACODEC 0
%define CONFIG_OPENAL 0
%define CONFIG_OPENGL 0
+%define CONFIG_POCKETSPHINX 0
%define CONFIG_VAPOURSYNTH 0
%define CONFIG_ALSA 0
%define CONFIG_APPKIT 0
@@ -926,6 +930,7 @@
%define CONFIG_VMDVIDEO_DECODER 0
%define CONFIG_VMNC_DECODER 0
%define CONFIG_VP3_DECODER 1
+%define CONFIG_VP4_DECODER 0
%define CONFIG_VP5_DECODER 0
%define CONFIG_VP6_DECODER 0
%define CONFIG_VP6A_DECODER 0
@@ -1604,7 +1609,9 @@
%define CONFIG_ASETTB_FILTER 0
%define CONFIG_ASHOWINFO_FILTER 0
%define CONFIG_ASIDEDATA_FILTER 0
+%define CONFIG_ASOFTCLIP_FILTER 0
%define CONFIG_ASPLIT_FILTER 0
+%define CONFIG_ASR_FILTER 0
%define CONFIG_ASTATS_FILTER 0
%define CONFIG_ASTREAMSELECT_FILTER 0
%define CONFIG_ATEMPO_FILTER 0
@@ -1623,6 +1630,7 @@
%define CONFIG_CROSSFEED_FILTER 0
%define CONFIG_CRYSTALIZER_FILTER 0
%define CONFIG_DCSHIFT_FILTER 0
+%define CONFIG_DEESSER_FILTER 0
%define CONFIG_DRMETER_FILTER 0
%define CONFIG_DYNAUDNORM_FILTER 0
%define CONFIG_EARWAX_FILTER 0
@@ -1695,6 +1703,7 @@
%define CONFIG_COLORCHANNELMIXER_FILTER 0
%define CONFIG_COLORKEY_FILTER 0
%define CONFIG_COLORKEY_OPENCL_FILTER 0
+%define CONFIG_COLORHOLD_FILTER 0
%define CONFIG_COLORLEVELS_FILTER 0
%define CONFIG_COLORMATRIX_FILTER 0
%define CONFIG_COLORSPACE_FILTER 0
@@ -1722,6 +1731,7 @@
%define CONFIG_DEJUDDER_FILTER 0
%define CONFIG_DELOGO_FILTER 0
%define CONFIG_DENOISE_VAAPI_FILTER 0
+%define CONFIG_DERAIN_FILTER 0
%define CONFIG_DESHAKE_FILTER 0
%define CONFIG_DESPILL_FILTER 0
%define CONFIG_DETELECINE_FILTER 0
@@ -1808,6 +1818,7 @@
%define CONFIG_MPDECIMATE_FILTER 0
%define CONFIG_NEGATE_FILTER 0
%define CONFIG_NLMEANS_FILTER 0
+%define CONFIG_NLMEANS_OPENCL_FILTER 0
%define CONFIG_NNEDI_FILTER 0
%define CONFIG_NOFORMAT_FILTER 0
%define CONFIG_NOISE_FILTER 0
@@ -1927,6 +1938,7 @@
%define CONFIG_WAVEFORM_FILTER 0
%define CONFIG_WEAVE_FILTER 0
%define CONFIG_XBR_FILTER 0
+%define CONFIG_XMEDIAN_FILTER 0
%define CONFIG_XSTACK_FILTER 0
%define CONFIG_YADIF_FILTER 0
%define CONFIG_YADIF_CUDA_FILTER 0
@@ -1963,6 +1975,7 @@
%define CONFIG_CONCAT_FILTER 0
%define CONFIG_SHOWCQT_FILTER 0
%define CONFIG_SHOWFREQS_FILTER 0
+%define CONFIG_SHOWSPATIAL_FILTER 0
%define CONFIG_SHOWSPECTRUM_FILTER 0
%define CONFIG_SHOWSPECTRUMPIC_FILTER 0
%define CONFIG_SHOWVOLUME_FILTER 0
@@ -2076,6 +2089,7 @@
%define CONFIG_IDCIN_DEMUXER 0
%define CONFIG_IDF_DEMUXER 0
%define CONFIG_IFF_DEMUXER 0
+%define CONFIG_IFV_DEMUXER 0
%define CONFIG_ILBC_DEMUXER 0
%define CONFIG_IMAGE2_DEMUXER 0
%define CONFIG_IMAGE2PIPE_DEMUXER 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 e59a377c705..bb942ed6a8d 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,7 +1,7 @@
/* Automatically generated by configure - do not modify! */
#ifndef FFMPEG_CONFIG_H
#define FFMPEG_CONFIG_H
-/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/hdd1/workspace/chrome2/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/um --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/shared --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/winrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Include/10.0.17763.0/ucrt --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/hdd1/workspace/chrome2/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/ucrt/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/win_sdk/Lib/10.0.17763.0/um/x64' --extra-ldflags='-libpath:/hdd1/workspace/chrome2/src/third_party/depot_tools/win_toolchain/vs_files/818a152b3f1da991c1725d85be19a0f27af6bab4/VC/Tools/MSVC/14.16.27023/lib/x64'" -- elide long configuration string from binary */
+/* #define FFMPEG_CONFIGURATION "--disable-everything --disable-all --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --enable-avcodec --enable-avformat --enable-avutil --enable-fft --enable-rdft --enable-static --enable-libopus --disable-debug --disable-bzlib --disable-error-resilience --disable-iconv --disable-lzo --disable-network --disable-schannel --disable-sdl2 --disable-symver --disable-xlib --disable-zlib --disable-securetransport --disable-faan --disable-alsa --disable-autodetect --enable-decoder='vorbis,libopus,flac' --enable-decoder='pcm_u8,pcm_s16le,pcm_s24le,pcm_s32le,pcm_f32le,mp3' --enable-decoder='pcm_s16be,pcm_s24be,pcm_mulaw,pcm_alaw' --enable-demuxer='ogg,matroska,wav,flac,mp3,mov' --enable-parser='opus,vorbis,flac,mpegaudio,vp9' --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/opus/src/include --disable-linux-perf --x86asmexe=nasm --optflags='\"-O2\"' --enable-decoder='theora,vp8' --enable-parser='vp3,vp8' --toolchain=msvc --extra-cflags=-I/ssd/trunk_blink_tot/src/third_party/ffmpeg/chromium/include/win --target-os=win64 --enable-cross-compile --cc=clang-cl --ld=lld-link --nm=llvm-nm --ar=llvm-ar --extra-cflags=-O2 --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/um --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/shared --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/winrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Include/10.0.18362.0/ucrt --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/include --extra-cflags=-imsvc/ssd/trunk_blink_tot/src/third_party/ffmpeg/../depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/include --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/atlmfc/lib/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/ucrt/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/win_sdk/Lib/10.0.18362.0/um/x64' --extra-ldflags='-libpath:/ssd/trunk_blink_tot/src/third_party/depot_tools/win_toolchain/vs_files/418b3076791776573a815eb298c8aa590307af63/VC/Tools/MSVC/14.16.27023/lib/x64'" -- elide long configuration string from binary */
#define FFMPEG_LICENSE "LGPL version 2.1 or later"
#define CONFIG_THIS_YEAR 2019
#define FFMPEG_DATADIR "/usr/local/share/ffmpeg"
@@ -80,6 +80,7 @@
#define HAVE_MIPSDSP 0
#define HAVE_MIPSDSPR2 0
#define HAVE_MSA 0
+#define HAVE_MSA2 0
#define HAVE_LOONGSON2 0
#define HAVE_LOONGSON3 0
#define HAVE_MMI 0
@@ -125,6 +126,7 @@
#define HAVE_MIPSDSP_EXTERNAL 0
#define HAVE_MIPSDSPR2_EXTERNAL 0
#define HAVE_MSA_EXTERNAL 0
+#define HAVE_MSA2_EXTERNAL 0
#define HAVE_LOONGSON2_EXTERNAL 0
#define HAVE_LOONGSON3_EXTERNAL 0
#define HAVE_MMI_EXTERNAL 0
@@ -170,6 +172,7 @@
#define HAVE_MIPSDSP_INLINE 0
#define HAVE_MIPSDSPR2_INLINE 0
#define HAVE_MSA_INLINE 0
+#define HAVE_MSA2_INLINE 0
#define HAVE_LOONGSON2_INLINE 0
#define HAVE_LOONGSON3_INLINE 0
#define HAVE_MMI_INLINE 0
@@ -489,6 +492,7 @@
#define CONFIG_MEDIACODEC 0
#define CONFIG_OPENAL 0
#define CONFIG_OPENGL 0
+#define CONFIG_POCKETSPHINX 0
#define CONFIG_VAPOURSYNTH 0
#define CONFIG_ALSA 0
#define CONFIG_APPKIT 0
@@ -941,6 +945,7 @@
#define CONFIG_VMDVIDEO_DECODER 0
#define CONFIG_VMNC_DECODER 0
#define CONFIG_VP3_DECODER 1
+#define CONFIG_VP4_DECODER 0
#define CONFIG_VP5_DECODER 0
#define CONFIG_VP6_DECODER 0
#define CONFIG_VP6A_DECODER 0
@@ -1619,7 +1624,9 @@
#define CONFIG_ASETTB_FILTER 0
#define CONFIG_ASHOWINFO_FILTER 0
#define CONFIG_ASIDEDATA_FILTER 0
+#define CONFIG_ASOFTCLIP_FILTER 0
#define CONFIG_ASPLIT_FILTER 0
+#define CONFIG_ASR_FILTER 0
#define CONFIG_ASTATS_FILTER 0
#define CONFIG_ASTREAMSELECT_FILTER 0
#define CONFIG_ATEMPO_FILTER 0
@@ -1638,6 +1645,7 @@
#define CONFIG_CROSSFEED_FILTER 0
#define CONFIG_CRYSTALIZER_FILTER 0
#define CONFIG_DCSHIFT_FILTER 0
+#define CONFIG_DEESSER_FILTER 0
#define CONFIG_DRMETER_FILTER 0
#define CONFIG_DYNAUDNORM_FILTER 0
#define CONFIG_EARWAX_FILTER 0
@@ -1710,6 +1718,7 @@
#define CONFIG_COLORCHANNELMIXER_FILTER 0
#define CONFIG_COLORKEY_FILTER 0
#define CONFIG_COLORKEY_OPENCL_FILTER 0
+#define CONFIG_COLORHOLD_FILTER 0
#define CONFIG_COLORLEVELS_FILTER 0
#define CONFIG_COLORMATRIX_FILTER 0
#define CONFIG_COLORSPACE_FILTER 0
@@ -1737,6 +1746,7 @@
#define CONFIG_DEJUDDER_FILTER 0
#define CONFIG_DELOGO_FILTER 0
#define CONFIG_DENOISE_VAAPI_FILTER 0
+#define CONFIG_DERAIN_FILTER 0
#define CONFIG_DESHAKE_FILTER 0
#define CONFIG_DESPILL_FILTER 0
#define CONFIG_DETELECINE_FILTER 0
@@ -1823,6 +1833,7 @@
#define CONFIG_MPDECIMATE_FILTER 0
#define CONFIG_NEGATE_FILTER 0
#define CONFIG_NLMEANS_FILTER 0
+#define CONFIG_NLMEANS_OPENCL_FILTER 0
#define CONFIG_NNEDI_FILTER 0
#define CONFIG_NOFORMAT_FILTER 0
#define CONFIG_NOISE_FILTER 0
@@ -1942,6 +1953,7 @@
#define CONFIG_WAVEFORM_FILTER 0
#define CONFIG_WEAVE_FILTER 0
#define CONFIG_XBR_FILTER 0
+#define CONFIG_XMEDIAN_FILTER 0
#define CONFIG_XSTACK_FILTER 0
#define CONFIG_YADIF_FILTER 0
#define CONFIG_YADIF_CUDA_FILTER 0
@@ -1978,6 +1990,7 @@
#define CONFIG_CONCAT_FILTER 0
#define CONFIG_SHOWCQT_FILTER 0
#define CONFIG_SHOWFREQS_FILTER 0
+#define CONFIG_SHOWSPATIAL_FILTER 0
#define CONFIG_SHOWSPECTRUM_FILTER 0
#define CONFIG_SHOWSPECTRUMPIC_FILTER 0
#define CONFIG_SHOWVOLUME_FILTER 0
@@ -2091,6 +2104,7 @@
#define CONFIG_IDCIN_DEMUXER 0
#define CONFIG_IDF_DEMUXER 0
#define CONFIG_IFF_DEMUXER 0
+#define CONFIG_IFV_DEMUXER 0
#define CONFIG_ILBC_DEMUXER 0
#define CONFIG_IMAGE2_DEMUXER 0
#define CONFIG_IMAGE2PIPE_DEMUXER 0
diff --git a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h
index 5a1ba063f01..e4a455c28f9 100644
--- a/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h
+++ b/chromium/third_party/ffmpeg/chromium/config/Chromium/win/x64/libavutil/ffversion.h
@@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
-#define FFMPEG_VERSION "N-94581-gb4c1b9c2a7"
+#define FFMPEG_VERSION "N-95241-g23ca8fd9e6"
#endif /* AVUTIL_FFVERSION_H */
diff --git a/chromium/third_party/ffmpeg/chromium/patches/README b/chromium/third_party/ffmpeg/chromium/patches/README
index 2f13f1be4d6..e279df2467c 100644
--- a/chromium/third_party/ffmpeg/chromium/patches/README
+++ b/chromium/third_party/ffmpeg/chromium/patches/README
@@ -808,38 +808,6 @@ Affects:
libavformat/mov.c
------------------------------------------------------------------
-commit d17a8c9b951d5c4cc8fd2027db48b657deec290f
-Author: Dan Sanders <sandersd@chromium.org>
-Date: Fri Apr 19 14:52:58 2019 -0700
-
- libavformat/mov: limit nb_frames_for_fps to INT_MAX
-
- Bug: 827894
- Change-Id: I0de1422ba7c8bfb4d66675552d5704bb86ea1fe2
- Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1575672
- Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
-
-Affects:
- libavformat/mov.c
-
-------------------------------------------------------------------
-commit d82e355b42a185683ce8c19ccb27e162c9ff66e8
-Author: Dan Sanders <sandersd@chromium.org>
-Date: Mon Apr 22 11:08:48 2019 -0700
-
- libavformat/mov: limit nb_frames_for_fps to INT_MAX
-
- Part 2.
-
- Bug: 827894
- Change-Id: Icf597a26f817f342cf120f0c9c17a95122a45797
- Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1577698
- Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
-
-Affects:
- libavformat/mov.c
-
-------------------------------------------------------------------
commit 68f1932090d5e35d958434d0588a33986cd3d65d
Author: Felicia Lim <flim@chromium.org>
Date: Thu May 9 17:40:11 2019 -0700
@@ -861,9 +829,25 @@ Affects:
libavcodec/libopusdec.c
------------------------------------------------------------------
-commit 4267885f5c532b54fa7ee40c9915fa452dd1dfc5
+commit feb5456cf973a819ace9a5001256f168631b6788
+Merge: 464c195d8b 81d3d7dd44
+Author: Matt Wolenetz <wolenetz@chromium.org>
+Date: Fri Jul 12 15:20:19 2019 -0700
+
+ Merge remote-tracking branch 'upstream/master' into sushi-2019-07-12-14-09-15
+
+ Manually resolved conflicts:
+ .gitignore
+ configure
+ libavformat/matroskadec.c
+
+Affects:
+ libavformat/matroskadec.c
+
+------------------------------------------------------------------
+commit dfc85c1198d09a2e3c3e3aa6cba330894d8a94c4
Author: Matt Wolenetz <wolenetz@chromium.org>
-Date: Wed Jul 24 16:38:05 2019 -0700
+Date: Wed Jul 24 16:28:05 2019 -0700
wavdec: Fail bext parsing on incomplete reads
@@ -879,11 +863,6 @@ Date: Wed Jul 24 16:38:05 2019 -0700
BUG=987270
- Change-Id: I5b2fc654b865195a7c5e3932fd2e3a3eaeff04f7
- Reviewed-on: https://chromium-review.googlesource.com/c/chromium/third_party/ffmpeg/+/1717599
- Reviewed-by: Frank Liberato <liberato@chromium.org>
- (cherry picked from commit e0e3133c40fbca0032a2d9400da736e4b933882f)
-
Affects:
libavformat/wavdec.c
diff --git a/chromium/third_party/ffmpeg/chromium/patches/config_flag_changes.txt b/chromium/third_party/ffmpeg/chromium/patches/config_flag_changes.txt
index a377c7b8fc2..82da4ceda9a 100644
--- a/chromium/third_party/ffmpeg/chromium/patches/config_flag_changes.txt
+++ b/chromium/third_party/ffmpeg/chromium/patches/config_flag_changes.txt
@@ -1,9 +1,16 @@
-+ CONFIG_ADPCM_AGM_DECODER 0
-+ CONFIG_AV1_FRAME_SPLIT_BSF 0
-+ CONFIG_COLORKEY_OPENCL_FILTER 0
-+ CONFIG_KUX_DEMUXER 0
-+ CONFIG_LAGFUN_FILTER 0
-+ CONFIG_LSCR_DECODER 0
-+ HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE 0
-- HAVE_VALGRIND_VALGRIND_H 0
-+ HAVE_VALGRIND_VALGRIND_H 1
++ CONFIG_ASOFTCLIP_FILTER 0
++ CONFIG_ASR_FILTER 0
++ CONFIG_COLORHOLD_FILTER 0
++ CONFIG_DEESSER_FILTER 0
++ CONFIG_DERAIN_FILTER 0
++ CONFIG_IFV_DEMUXER 0
++ CONFIG_NLMEANS_OPENCL_FILTER 0
++ CONFIG_POCKETSPHINX 0
++ CONFIG_SHOWSPATIAL_FILTER 0
++ CONFIG_VP4_DECODER 0
++ CONFIG_XMEDIAN_FILTER 0
++ HAVE_MSA2 0
++ HAVE_MSA2_EXTERNAL 0
++ HAVE_MSA2_INLINE 0
++ HAVE_VALGRIND_VALGRIND_H 0
+- HAVE_VALGRIND_VALGRIND_H 1
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py
index edfa1c4a65d..cf14c7ffa0d 100644
--- a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater.py
@@ -324,7 +324,8 @@ class CreditsUpdater(object):
open_output.writelines(open_license_md.readlines())
# Next write verbatim headers from the generated credits map.
- for filename, file_license in self.generated_credits.iteritems():
+ for filename, file_license in sorted(self.generated_credits.iteritems(),
+ key=lambda x: x[0]):
open_output.writelines(LICENSE_SEPARATOR)
open_output.writelines('%s\n\n%s' % (filename, file_license))
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py
index 2c1f6353d07..458a2c06112 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/credits_updater_unittest.py
@@ -116,6 +116,32 @@ class CreditsUpdaterUnittest(unittest.TestCase):
credits_lines = ReadCreditsLines()
self.assertEqual(expected_lines, credits_lines)
+ def testGeneratedLicencesOrder(self):
+ # Process files that do not fall into a known bucket and assert that their
+ # licenses are listed in alphabetical order of the file names.
+ files = [
+ 'libswresample/swresample.h',
+ 'libavcodec/arm/jrevdct_arm.S',
+ 'libavcodec/mips/celp_math_mips.c',
+ 'libavcodec/mips/acelp_vectors_mips.c',
+ 'libavformat/oggparsetheora.c',
+ 'libavcodec/x86/xvididct.asm',
+ ]
+ updater = NewCreditsUpdater()
+ for f in files:
+ updater.ProcessFile(f)
+ updater.WriteCredits()
+
+ credits = ''.join(ReadCreditsLines())
+ current_offset = 0
+ for f in sorted(files):
+ i = string.find(credits, f, current_offset)
+ if i == -1:
+ self.fail("Failed to find %s starting at offset %s of content:\n%s" %
+ (f, current_offset, credits))
+ current_offset = i + len(f)
+
+
def testKnownFileDigestChange(self):
updater = NewCreditsUpdater()
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py b/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py
index 1f5ab074f43..d2b3d1052aa 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py
@@ -720,6 +720,7 @@ def GetIncludedSources(file_path, source_dir, include_set):
# absolute paths in the set to avoid same-name-errors.
if not os.path.isabs(file_path):
file_path = os.path.abspath(os.path.join(source_dir, file_path))
+ file_path = os.path.normpath(file_path)
current_dir = os.path.dirname(file_path)
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py b/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py
index 209e8593f23..9f3cf17e087 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py
@@ -218,9 +218,11 @@ class SourceSetUnittest(unittest.TestCase):
stanza = disjoint_sets[0].GenerateGnStanza()
self.assertEqual(string.find(stanza, bad_condition), -1)
- def assertEqualSets(self, expected, actual):
+ def assertEqualSourceSets(self, expected, actual):
+ assert all(isinstance(a, SourceSet) for a in expected)
+ assert all(isinstance(a, SourceSet) for a in actual)
- def SetToString(source_set):
+ def SourceSetToString(source_set):
sources = [str(e) for e in source_set.sources]
conditions = [str(e) for e in source_set.conditions]
sources_str = ','.join(sources)
@@ -233,11 +235,11 @@ class SourceSetUnittest(unittest.TestCase):
if len(missing_elements):
msg += 'Missing expected elements:\n'
for e in missing_elements:
- msg += SetToString(e) + '\n'
+ msg += SourceSetToString(e) + '\n'
if len(extra_elements):
msg += 'Found extra elements:\n'
for e in extra_elements:
- msg += SetToString(e) + '\n'
+ msg += SourceSetToString(e) + '\n'
self.assertTrue(expected == actual, msg=msg)
@@ -263,7 +265,7 @@ class SourceSetUnittest(unittest.TestCase):
'win')])))
source_sets = gg.CreatePairwiseDisjointSets([a, b])
- self.assertEqualSets(expected, set(source_sets))
+ self.assertEqualSourceSets(expected, set(source_sets))
def testCreatePairwiseDisjointSets_Triplet(self):
a = SourceSet(
@@ -301,7 +303,7 @@ class SourceSetUnittest(unittest.TestCase):
set(['arm']), set([SourceListCondition('arm', 'Chromium', 'win')])))
source_sets = gg.CreatePairwiseDisjointSets([a, b, c])
- self.assertEqualSets(expected, set(source_sets))
+ self.assertEqualSourceSets(expected, set(source_sets))
def testCreatePairwiseDisjointSets_Multiple(self):
a = SourceSet(
@@ -362,7 +364,7 @@ class SourceSetUnittest(unittest.TestCase):
set([SourceListCondition('arm-neon', 'ChromeOS', 'linux')])))
source_sets = gg.CreatePairwiseDisjointSets([a, b, c, d, e, f])
- self.assertEqualSets(expected, set(source_sets))
+ self.assertEqualSourceSets(expected, set(source_sets))
def testReduceConditions(self):
# Set conditions span all of the supported architectures for linux.
@@ -381,7 +383,7 @@ class SourceSetUnittest(unittest.TestCase):
# Conditions should reduce to a single condition with wild-card for arch.
expected = set([SourceListCondition('*', 'Chromium', 'linux')])
- self.assertEqualSets(expected, a.conditions)
+ self.assertEqual(expected, a.conditions)
# Set conditions span all of the supported architectures for windows.
b = SourceSet(
@@ -395,7 +397,7 @@ class SourceSetUnittest(unittest.TestCase):
# Conditions should reduce to a single condition with wild-card for
expected = set([SourceListCondition('*', 'Chromium', 'win')])
- self.assertEqualSets(expected, b.conditions)
+ self.assertEqual(expected, b.conditions)
# Set conditions span all supported architectures and brandings for windows.
b = SourceSet(
@@ -410,7 +412,7 @@ class SourceSetUnittest(unittest.TestCase):
]))
gg.ReduceConditionalLogic(b)
expected = set([SourceListCondition('*', '*', 'win')])
- self.assertEqualSets(expected, b.conditions)
+ self.assertEqual(expected, b.conditions)
# Set conditions span all supported platforms.
c = SourceSet(
@@ -423,7 +425,7 @@ class SourceSetUnittest(unittest.TestCase):
]))
gg.ReduceConditionalLogic(c)
expected = set([SourceListCondition('x64', 'Chromium', '*')])
- self.assertEqualSets(expected, c.conditions)
+ self.assertEqual(expected, c.conditions)
# Spans all architectures for Chromium, but also all targets for ia32 & win.
d = SourceSet(
@@ -439,7 +441,7 @@ class SourceSetUnittest(unittest.TestCase):
SourceListCondition('*', 'Chromium', 'win'),
SourceListCondition('ia32', '*', 'win'),
])
- self.assertEqualSets(expected, d.conditions)
+ self.assertEqual(expected, d.conditions)
def testReduceConditions_fullSpan(self):
# Build SourceSet with conditions spanning every combination of attributes.
@@ -451,7 +453,7 @@ class SourceSetUnittest(unittest.TestCase):
gg.ReduceConditionalLogic(ss)
expected = set([SourceListCondition('*', '*', '*')])
- self.assertEqualSets(expected, ss.conditions)
+ self.assertEqual(expected, ss.conditions)
def testGenerateStanzaWildCard(self):
a = SourceSet(
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/robo_branch.py b/chromium/third_party/ffmpeg/chromium/scripts/robo_branch.py
index 35c82b7ba19..39c00ea6f55 100644
--- a/chromium/third_party/ffmpeg/chromium/scripts/robo_branch.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/robo_branch.py
@@ -14,6 +14,7 @@ import check_merge
from datetime import datetime
import find_patches
import os
+import re
from robo_lib import UserInstructions
from robo_lib import log
from subprocess import check_output
@@ -88,18 +89,34 @@ def MergeUpstreamToSushiBranch(cfg):
raise UserInstructions("Merge failed -- resolve conflicts manually.")
log("Merge has completed successfully")
-def IsMergeCommitOnThisBranch(cfg):
- """Return true if there's a merge commit on this branch before it joins up
- with origin/master."""
+def GetMergeParentsIfAny(cfg):
+ """Return the set of commit sha-1s of the merge commit, if one exists, between
+ HEAD and where it joins up with origin/master. Otherwise, return []."""
# Get all sha1s between us and origin/master
sha1s = check_output(["git", "log", "--format=%H",
"origin/master..%s" % cfg.branch_name()]).split()
for sha1 in sha1s:
# Does |sha1| have more than one parent commit?
- if len(check_output(["git", "show", "--no-patch", "--format=%P",
- sha1]).split()) > 1:
- return True
- return False
+ parents = check_output(["git", "show", "--no-patch", "--format=%P",
+ sha1]).split()
+ if len(parents) > 1:
+ return parents
+ return []
+
+def IsMergeCommitOnThisBranch(cfg):
+ """Return true if there's a merge commit on this branch."""
+ return GetMergeParentsIfAny(cfg) != []
+
+def FindUpstreamMergeParent(cfg):
+ """Return the sha-1 of the upstream side of the merge, if there is a merge
+ commit on this branch. Otherwise, fail."""
+ sha1s = GetMergeParentsIfAny(cfg)
+ for sha1 in sha1s:
+ # 'not' is correct -- it returns zero if it is an ancestor => upstream.
+ if not cfg.Call(["git", "merge-base", "--is-ancestor", sha1,
+ "upstream/master"]):
+ return sha1
+ raise Exception("No upstream merge parent found. Is the merge committed?")
def MergeUpstreamToSushiBranchIfNeeded(cfg):
"""Start a merge if we've not started one before, or do nothing successfully
@@ -203,8 +220,37 @@ def IsPatchesFileDone(robo_configuration):
return True
return False
+@RequiresCleanWorkingDirectory
def UpdatePatchesFileUnconditionally(robo_configuration):
"""Update the patches file."""
WritePatchesReadme(robo_configuration)
AddAndCommit(robo_configuration,
robo_configuration.patches_commit_title())
+
+def IsChromiumReadmeDone(robo_configuration):
+ """Return False if and only if README.chromium isn't checked in."""
+ if IsCommitOnThisBranch(
+ robo_configuration,
+ robo_configuration.readme_chromium_commit_title()):
+ log("Skipping README.chromium file since already committed")
+ return True
+ return False
+
+@RequiresCleanWorkingDirectory
+def UpdateChromiumReadmeWithUpstream(robo_configuration):
+ """Update the upstream info in README.chromium and commit the result."""
+ log("Updating merge info in README.chromium")
+ merge_sha1 = FindUpstreamMergeParent(robo_configuration)
+ robo_configuration.chdir_to_ffmpeg_home();
+ with open("README.chromium", "r+") as f:
+ readme = f.read()
+ last_upstream_merge = "Last Upstream Merge:"
+ merge_date= check_output(["git", "log", "-1","--date=format:%b %d %Y",
+ "--format=%cd", merge_sha1])
+ readme = re.sub(r"(Last Upstream Merge:).*\n",
+ r"\1 %s, %s" % (merge_sha1, merge_date),
+ readme)
+ with open("README.chromium", "w") as f:
+ f.write(readme)
+ AddAndCommit(robo_configuration,
+ robo_configuration.readme_chromium_commit_title())
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/robo_lib.py b/chromium/third_party/ffmpeg/chromium/scripts/robo_lib.py
index c008d3afee1..0c2f3c0696e 100644
--- a/chromium/third_party/ffmpeg/chromium/scripts/robo_lib.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/robo_lib.py
@@ -39,6 +39,8 @@ class RoboConfiguration:
self._gn_commit_title = "GN Configuration"
# Title of the commit with chromium/patches/README.
self._patches_commit_title = "Chromium patches file"
+ # Title of the commit with README.chromium
+ self._readme_chromium_commit_title = "README.chromium file"
self.EnsureHostInfo()
self.EnsureChromeSrc()
@@ -112,6 +114,9 @@ class RoboConfiguration:
def patches_commit_title(self):
return self._patches_commit_title
+ def readme_chromium_commit_title(self):
+ return self._readme_chromium_commit_title
+
def nasm_path(self):
return self._nasm_path
diff --git a/chromium/third_party/ffmpeg/chromium/scripts/robosushi.py b/chromium/third_party/ffmpeg/chromium/scripts/robosushi.py
index 08c508fffce..e9dd3721a78 100755
--- a/chromium/third_party/ffmpeg/chromium/scripts/robosushi.py
+++ b/chromium/third_party/ffmpeg/chromium/scripts/robosushi.py
@@ -102,6 +102,10 @@ steps = {
{ "desc": "Rewrite chromium/patches/README and commit locally if needed.",
"skip_fn": robo_branch.IsPatchesFileDone,
"do_fn": robo_branch.UpdatePatchesFileUnconditionally },
+ "update_chromium_readme":
+ { "desc": "Rewrite README.chromium to reflect the upstream SHA-1.",
+ "skip_fn": robo_branch.IsChromiumReadmeDone,
+ "do_fn": robo_branch.UpdateChromiumReadmeWithUpstream },
"run_tests":
{ "desc": "Compile and run ffmpeg_regression_tests and media_unittests",
"do_fn": robo_build.RunTests },
@@ -113,6 +117,7 @@ steps = {
"push_merge_to_origin",
"build_gn_configs",
"update_patches_file",
+ "update_chromium_readme",
# TODO: If the tests fail, and this is a manual roll, then the right thing
# to do is to upload the gn config / patches for review and land it.
"run_tests",
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h b/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
index 605b92ae62f..8d17125adca 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avisynth_c.h
@@ -34,6 +34,22 @@
// NOTE: this is a partial update of the Avisynth C interface to recognize
// new color spaces added in Avisynth 2.60. By no means is this document
// completely Avisynth 2.60 compliant.
+// 170103: added new CPU constants (FMA4, AVX512xx)
+// 171102: define SIZETMOD. do not use yet, experimental. Offsets are size_t instead of int. Affects x64.
+// 171106: avs_get_row_size calls into avs_get_row_size_p, instead of direct field access
+// 171106: avs_get_height calls into avs_get_row_size_p, instead of direct field access
+// 180524: AVSC_EXPORT to dllexport in capi.h for avisynth_c_plugin_init
+// 180524: avs_is_same_colorspace VideoInfo parameters to const
+// 181230: Readability: functions regrouped to mix less AVSC_API and AVSC_INLINE, put together Avisynth+ specific stuff
+// 181230: use #ifndef AVSC_NO_DECLSPEC for AVSC_INLINE functions which are calling API functions
+// 181230: comments on avs_load_library (helper for loading API entries dynamically into a struct using AVSC_NO_DECLSPEC define)
+// 181230: define alias AVS_FRAME_ALIGN as FRAME_ALIGN
+// 181230: remove unused form of avs_get_rowsize and avs_get_height (kept earlier for reference)
+// 190104: avs_load_library: smart fallback mechanism for Avisynth+ specific functions:
+// if they are not loadable, they will work in a classic Avisynth compatible mode
+// Example#1: e.g. avs_is_444 will call the existing avs_is_yv24 instead
+// Example#2: avs_bits_per_component will return 8 for all colorspaces (Classic Avisynth supports only 8 bits/pixel)
+// Thus the Avisynth+ specific API functions are safely callable even when connected to classic Avisynth DLL
#ifndef __AVISYNTH_C__
#define __AVISYNTH_C__
@@ -42,7 +58,7 @@
#include "avs/capi.h"
#include "avs/types.h"
-
+#define AVS_FRAME_ALIGN FRAME_ALIGN
/////////////////////////////////////////////////////////////////////
//
// Constants
@@ -124,7 +140,7 @@ enum {
AVS_CS_GENERIC_YUVA444 = AVS_CS_PLANAR | AVS_CS_YUVA | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_1 }; // 4:4:4:A planar
- // Specific colorformats
+ // Specific color formats
enum {
AVS_CS_UNKNOWN = 0,
AVS_CS_BGR24 = AVS_CS_RGB_TYPE | AVS_CS_BGR | AVS_CS_INTERLEAVED,
@@ -134,18 +150,18 @@ enum {
// AVS_CS_I420 = 1<<4 Reserved
AVS_CS_RAW32 = 1<<5 | AVS_CS_INTERLEAVED,
- AVS_CS_YV24 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_8, // YVU 4:4:4 planar
- AVS_CS_YV16 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_8, // YVU 4:2:2 planar
- AVS_CS_YV12 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_8, // YVU 4:2:0 planar
+ AVS_CS_YV24 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_8, // YUV 4:4:4 planar
+ AVS_CS_YV16 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_8, // YUV 4:2:2 planar
+ AVS_CS_YV12 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_8, // YUV 4:2:0 planar
AVS_CS_I420 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_UPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // YUV 4:2:0 planar
AVS_CS_IYUV = AVS_CS_I420,
- AVS_CS_YV411 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_4, // YVU 4:1:1 planar
- AVS_CS_YUV9 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_4 | AVS_CS_SUB_WIDTH_4, // YVU 4:1:0 planar
+ AVS_CS_YV411 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_4, // YUV 4:1:1 planar
+ AVS_CS_YUV9 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_4 | AVS_CS_SUB_WIDTH_4, // YUV 4:1:0 planar
AVS_CS_Y8 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_8, // Y 4:0:0 planar
//-------------------------
// AVS16: new planar constants go live! Experimental PF 160613
- // 10-12-14 bit + planar RGB + BRG48/64 160725
+ // 10-12-14-16 bit + planar RGB + BGR48/64 160725
AVS_CS_YUV444P10 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_10, // YUV 4:4:4 10bit samples
AVS_CS_YUV422P10 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_10, // YUV 4:2:2 10bit samples
AVS_CS_YUV420P10 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_10, // YUV 4:2:0 10bit samples
@@ -246,9 +262,9 @@ enum { //SUBTYPES
enum {
// New 2.6 explicitly defined cache hints.
AVS_CACHE_NOTHING=10, // Do not cache video.
- AVS_CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N.
- AVS_CACHE_GENERIC=12, // LRU cache upto X frames.
- AVS_CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW.
+ AVS_CACHE_WINDOW=11, // Hard protect up to X frames within a range of X from the current frame N.
+ AVS_CACHE_GENERIC=12, // LRU cache up to X frames.
+ AVS_CACHE_FORCE_GENERIC=13, // LRU cache up to X frames, override any previous CACHE_WINDOW.
AVS_CACHE_GET_POLICY=30, // Get the current policy.
AVS_CACHE_GET_WINDOW=31, // Get the current window h_span.
@@ -256,8 +272,8 @@ enum {
AVS_CACHE_AUDIO=50, // Explicitly do cache audio, X byte cache.
AVS_CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio.
- AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache.
- AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache.
+ AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte initial cache.
+ AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte initial cache.
AVS_CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy.
AVS_CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size.
@@ -284,7 +300,7 @@ enum {
AVS_CACHE_COST_MED=224, // Child response of medium cost. (Real time)
AVS_CACHE_COST_HI=225, // Child response of heavy cost. (Slow)
- AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness.
+ AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safety.
AVS_CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default!
AVS_CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default!
AVS_CACHE_THREAD_SAFE=243, // Allow all threads in any instance.
@@ -297,6 +313,8 @@ enum {
};
#ifdef BUILDING_AVSCORE
+AVSValue create_c_video_filter(AVSValue args, void * user_data, IScriptEnvironment * e0);
+
struct AVS_ScriptEnvironment {
IScriptEnvironment * env;
const char * error;
@@ -313,7 +331,7 @@ typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
// AVS_VideoInfo
//
-// AVS_VideoInfo is layed out identicly to VideoInfo
+// AVS_VideoInfo is laid out identically to VideoInfo
typedef struct AVS_VideoInfo {
int width, height; // width=0 means no video
unsigned fps_numerator, fps_denominator;
@@ -326,7 +344,7 @@ typedef struct AVS_VideoInfo {
INT64 num_audio_samples;
int nchannels;
- // Imagetype properties
+ // Image type properties
int image_type;
} AVS_VideoInfo;
@@ -353,89 +371,64 @@ AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
-AVSC_API(int, avs_is_rgb48)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p); // avs+: for generic 444 check, use avs_is_yuv444
-AVSC_API(int, avs_is_rgb64)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p); // avs+: for generic 422 check, use avs_is_yuv422
-AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ;
+AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ; // avs+: for generic 420 check, use avs_is_yuv420
AVSC_API(int, avs_is_yv411)(const AVS_VideoInfo * p);
-AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv444p16)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv422p16)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv420p16)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_y16)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv444ps)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv422ps)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_yuv420ps)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p); // avs+: for generic grayscale, use avs_is_y
-AVSC_API(int, avs_is_y32)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_444)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_422)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_is_420)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane);
-AVSC_API(int, avs_is_y)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane);
-AVSC_API(int, avs_is_yuva)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p);
-AVSC_API(int, avs_is_planar_rgb)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_bytes_from_pixels)(const AVS_VideoInfo * p, int pixels);
-AVSC_API(int, avs_is_planar_rgba)(const AVS_VideoInfo * p);
+AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane);
+AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi);
+AVSC_API(int, avs_is_color_space)(const AVS_VideoInfo * p, int c_space);
+// no API for these, inline helper functions
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
- { return ((p->image_type & property)==property ); }
+{
+ return ((p->image_type & property) == property);
+}
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
- { return !!(p->pixel_type & AVS_CS_PLANAR); }
-
-AVSC_API(int, avs_is_color_space)(const AVS_VideoInfo * p, int c_space);
+{
+ return !!(p->pixel_type & AVS_CS_PLANAR);
+}
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
- { return !!(p->image_type & AVS_IT_FIELDBASED); }
+{
+ return !!(p->image_type & AVS_IT_FIELDBASED);
+}
AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p)
- { return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); }
+{
+ return ((p->image_type & AVS_IT_FIELDBASED) && (p->image_type & (AVS_IT_BFF | AVS_IT_TFF)));
+}
AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
- { return !!(p->image_type & AVS_IT_BFF); }
+{
+ return !!(p->image_type & AVS_IT_BFF);
+}
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
- { return !!(p->image_type & AVS_IT_TFF); }
-
-AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane);
-
-AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane);
-
-
-AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p);
-
-AVSC_API(int, avs_bytes_from_pixels)(const AVS_VideoInfo * p, int pixels);
-
-AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane);
-
-AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi);
+{
+ return !!(p->image_type & AVS_IT_TFF);
+}
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
{ return p->audio_samples_per_second; }
-
AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p)
{
switch (p->sample_type) {
@@ -447,6 +440,7 @@ AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p)
default: return 0;
}
}
+
AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p)
{ return p->nchannels*avs_bytes_per_channel_sample(p);}
@@ -488,19 +482,56 @@ AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned den
p->fps_denominator = denominator/x;
}
-#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
-AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
+AVSC_INLINE int avs_is_same_colorspace(const AVS_VideoInfo * x, const AVS_VideoInfo * y)
{
return (x->pixel_type == y->pixel_type)
|| (avs_is_yv12(x) && avs_is_yv12(y));
}
#endif
+// Avisynth+ extensions
+AVSC_API(int, avs_is_rgb48)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_rgb64)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_yuv444p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv444
+
+AVSC_API(int, avs_is_yuv422p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv422
+
+AVSC_API(int, avs_is_yuv420p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv420
+
+AVSC_API(int, avs_is_y16)(const AVS_VideoInfo * p); // obsolete, use avs_is_y
+
+AVSC_API(int, avs_is_yuv444ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv444
+
+AVSC_API(int, avs_is_yuv422ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv422
+
+AVSC_API(int, avs_is_yuv420ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv420
+
+AVSC_API(int, avs_is_y32)(const AVS_VideoInfo * p); // obsolete, use avs_is_y
+
+AVSC_API(int, avs_is_444)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_422)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_420)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_y)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_yuva)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_planar_rgb)(const AVS_VideoInfo * p);
+
+AVSC_API(int, avs_is_planar_rgba)(const AVS_VideoInfo * p);
+
AVSC_API(int, avs_num_components)(const AVS_VideoInfo * p);
AVSC_API(int, avs_component_size)(const AVS_VideoInfo * p);
AVSC_API(int, avs_bits_per_component)(const AVS_VideoInfo * p);
+// end of Avisynth+ specific
/////////////////////////////////////////////////////////////////////
//
@@ -513,11 +544,15 @@ AVSC_API(int, avs_bits_per_component)(const AVS_VideoInfo * p);
// to be reused. The instances are deleted when the corresponding AVS
// file is closed.
-// AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer
+// AVS_VideoFrameBuffer is laid out identically to VideoFrameBuffer
// DO NOT USE THIS STRUCTURE DIRECTLY
typedef struct AVS_VideoFrameBuffer {
BYTE * data;
+#ifdef SIZETMOD
+ size_t data_size;
+#else
int data_size;
+#endif
// sequence_number is incremented every time the buffer is changed, so
// that stale views can tell they're no longer valid.
volatile long sequence_number;
@@ -527,56 +562,94 @@ typedef struct AVS_VideoFrameBuffer {
// VideoFrame holds a "window" into a VideoFrameBuffer.
-// AVS_VideoFrame is layed out identicly to IVideoFrame
+// AVS_VideoFrame is laid out identically to IVideoFrame
// DO NOT USE THIS STRUCTURE DIRECTLY
typedef struct AVS_VideoFrame {
volatile long refcount;
AVS_VideoFrameBuffer * vfb;
- int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture.
- int row_sizeUV, heightUV;
+#ifdef SIZETMOD
+ size_t offset;
+#else
+ int offset;
+#endif
+ int pitch, row_size, height;
+#ifdef SIZETMOD
+ size_t offsetU, offsetV;
+#else
+ int offsetU, offsetV;
+#endif
+ int pitchUV; // U&V offsets are from top of picture.
+ int row_sizeUV, heightUV; // for Planar RGB offsetU, offsetV is for the 2nd and 3rd Plane.
+ // for Planar RGB pitchUV and row_sizeUV = 0, because when no VideoInfo (MakeWriteable)
+ // the decision on existence of UV is checked by zero pitch
+ // AVS+ extension, avisynth.h: class does not break plugins if appended here
+#ifdef SIZETMOD
+ size_t offsetA;
+#else
+ int offsetA;
+#endif
+ int pitchA, row_sizeA; // 4th alpha plane support, pitch and row_size is 0 is none
} AVS_VideoFrame;
// Access functions for AVS_VideoFrame
AVSC_API(int, avs_get_pitch_p)(const AVS_VideoFrame * p, int plane);
-#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
+AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane);
+
+AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane);
+
+AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane);
+
+AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p);
+
+AVSC_API(BYTE *, avs_get_write_ptr_p)(const AVS_VideoFrame * p, int plane);
+
+AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
+// makes a shallow copy of a video frame
+AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
+
+// no API for these, inline helper functions
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
- return avs_get_pitch_p(p, 0);}
+ return avs_get_pitch_p(p, 0);
+}
#endif
-AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane);
-
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
- return p->row_size; }
+ return avs_get_row_size_p(p, 0); }
+#endif
-AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane);
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
- return p->height;}
-
-AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane);
+ return avs_get_height_p(p, 0);
+}
+#endif
-#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) {
return avs_get_read_ptr_p(p, 0);}
#endif
-AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p);
-
-AVSC_API(BYTE *, avs_get_write_ptr_p)(const AVS_VideoFrame * p, int plane);
-
-#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p) {
return avs_get_write_ptr_p(p, 0);}
#endif
-AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
-// makes a shallow copy of a video frame
-AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *);
-
#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f)
{avs_release_video_frame(f);}
+#endif
+
+#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f)
{return avs_copy_video_frame(f);}
#endif
@@ -587,14 +660,14 @@ AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f)
//
// Treat AVS_Value as a fat pointer. That is use avs_copy_value
-// and avs_release_value appropiaty as you would if AVS_Value was
+// and avs_release_value appropriately as you would if AVS_Value was
// a pointer.
// To maintain source code compatibility with future versions of the
// avisynth_c API don't use the AVS_Value directly. Use the helper
// functions below.
-// AVS_Value is layed out identicly to AVSValue
+// AVS_Value is laid out identically to AVSValue
typedef struct AVS_Value AVS_Value;
struct AVS_Value {
short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
@@ -610,15 +683,19 @@ struct AVS_Value {
} d;
};
-// AVS_Value should be initilized with avs_void.
+// AVS_Value should be initialized with avs_void.
// Should also set to avs_void after the value is released
-// with avs_copy_value. Consider it the equalvent of setting
+// with avs_copy_value. Consider it the equivalent of setting
// a pointer to NULL
static const AVS_Value avs_void = {'v'};
AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src);
AVSC_API(void, avs_release_value)(AVS_Value);
+AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
+AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
+
+// no API for these, inline helper functions
AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; }
AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; }
AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; }
@@ -628,9 +705,6 @@ AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; }
AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; }
AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; }
-AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *);
-AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *);
-
AVSC_INLINE int avs_as_bool(AVS_Value v)
{ return v.d.boolean; }
AVSC_INLINE int avs_as_int(AVS_Value v)
@@ -661,11 +735,13 @@ AVSC_INLINE AVS_Value avs_new_value_float(float v0)
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
{ AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
#ifndef AVSC_NO_DECLSPEC
+// this inline function is calling an API function
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
{ AVS_Value v; avs_set_to_clip(&v, v0); return v; }
#endif
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
{ AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = (short)size; return v; }
+// end of inline helper functions
/////////////////////////////////////////////////////////////////////
//
@@ -722,7 +798,7 @@ struct AVS_FilterInfo
// Create a new filter
// fi is set to point to the AVS_FilterInfo so that you can
-// modify it once it is initilized.
+// modify it once it is initialized.
// store_child should generally be set to true. If it is not
// set than ALL methods (the function pointers) must be defined
// If it is set than you do not need to worry about freeing the child
@@ -753,10 +829,26 @@ enum {
AVS_CPUF_SSSE3 = 0x200, // Core 2
AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield
AVS_CPUF_SSE4_1 = 0x400,
-//AVS_CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer
+ AVS_CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer
AVS_CPUF_SSE4_2 = 0x1000, // Nehalem
-//AVS_CPUF_AVX2 = 0x2000, // Haswell
-//AVS_CPUF_AVX512 = 0x4000, // Knights Landing
+ // AVS+
+ AVS_CPUF_AVX2 = 0x2000, // Haswell
+ AVS_CPUF_FMA3 = 0x4000,
+ AVS_CPUF_F16C = 0x8000,
+ AVS_CPUF_MOVBE = 0x10000, // Big Endian Move
+ AVS_CPUF_POPCNT = 0x20000,
+ AVS_CPUF_AES = 0x40000,
+ AVS_CPUF_FMA4 = 0x80000,
+
+ AVS_CPUF_AVX512F = 0x100000, // AVX-512 Foundation.
+ AVS_CPUF_AVX512DQ = 0x200000, // AVX-512 DQ (Double/Quad granular) Instructions
+ AVS_CPUF_AVX512PF = 0x400000, // AVX-512 Prefetch
+ AVS_CPUF_AVX512ER = 0x800000, // AVX-512 Exponential and Reciprocal
+ AVS_CPUF_AVX512CD = 0x1000000, // AVX-512 Conflict Detection
+ AVS_CPUF_AVX512BW = 0x2000000, // AVX-512 BW (Byte/Word granular) Instructions
+ AVS_CPUF_AVX512VL = 0x4000000, // AVX-512 VL (128/256 Vector Length) Extensions
+ AVS_CPUF_AVX512IFMA = 0x8000000, // AVX-512 IFMA integer 52 bit
+ AVS_CPUF_AVX512VBMI = 0x10000000 // AVX-512 VBMI
};
@@ -793,20 +885,23 @@ AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, con
AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
const AVS_VideoInfo * vi, int align);
-// align should be at least 16
+// align should be at least 16 for classic Avisynth
+// Avisynth+: any value, Avs+ ensures a minimum alignment if too small align is provided
+// no API for these, inline helper functions
#ifndef AVSC_NO_DECLSPEC
-AVSC_INLINE
-AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
+// this inline function is calling an API function
+AVSC_INLINE AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
const AVS_VideoInfo * vi)
- {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
+ {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
-AVSC_INLINE
-AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
+// an older compatibility alias
+// this inline function is calling an API function
+AVSC_INLINE AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
const AVS_VideoInfo * vi)
- {return avs_new_video_frame_a(env,vi,FRAME_ALIGN);}
+ {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
#endif
-
+// end of inline helper functions
AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf);
@@ -839,7 +934,10 @@ AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_Vid
// The returned video frame must be be released
#ifdef AVSC_NO_DECLSPEC
-// use LoadLibrary and related functions to dynamically load Avisynth instead of declspec(dllimport)
+// This part uses LoadLibrary and related functions to dynamically load Avisynth instead of declspec(dllimport)
+// When AVSC_NO_DECLSPEC is defined, you can use avs_load_library to populate API functions into a struct
+// AVSC_INLINE functions which call onto an API functions should be treated specially (todo)
+
/*
The following functions needs to have been declared, probably from windows.h
@@ -856,6 +954,14 @@ typedef struct AVS_Library AVS_Library;
#define AVSC_DECLARE_FUNC(name) name##_func name
+// AVSC_DECLARE_FUNC helps keeping naming convention: type is xxxxx_func, function name is xxxxx
+// e.g. "AVSC_DECLARE_FUNC(avs_add_function);"
+// is a shortcut for "avs_add_function_func avs_add_function;"
+
+// Note: AVSC_INLINE functions which call into API,
+// are guarded by #ifndef AVSC_NO_DECLSPEC
+// They should call the appropriate library-> API entry
+
struct AVS_Library {
HMODULE handle;
@@ -898,28 +1004,11 @@ struct AVS_Library {
AVSC_DECLARE_FUNC(avs_vsprintf);
AVSC_DECLARE_FUNC(avs_get_error);
- AVSC_DECLARE_FUNC(avs_is_rgb48);
- AVSC_DECLARE_FUNC(avs_is_rgb64);
AVSC_DECLARE_FUNC(avs_is_yv24);
AVSC_DECLARE_FUNC(avs_is_yv16);
AVSC_DECLARE_FUNC(avs_is_yv12);
AVSC_DECLARE_FUNC(avs_is_yv411);
AVSC_DECLARE_FUNC(avs_is_y8);
- AVSC_DECLARE_FUNC(avs_is_yuv444p16);
- AVSC_DECLARE_FUNC(avs_is_yuv422p16);
- AVSC_DECLARE_FUNC(avs_is_yuv420p16);
- AVSC_DECLARE_FUNC(avs_is_y16);
- AVSC_DECLARE_FUNC(avs_is_yuv444ps);
- AVSC_DECLARE_FUNC(avs_is_yuv422ps);
- AVSC_DECLARE_FUNC(avs_is_yuv420ps);
- AVSC_DECLARE_FUNC(avs_is_y32);
- AVSC_DECLARE_FUNC(avs_is_444);
- AVSC_DECLARE_FUNC(avs_is_422);
- AVSC_DECLARE_FUNC(avs_is_420);
- AVSC_DECLARE_FUNC(avs_is_y);
- AVSC_DECLARE_FUNC(avs_is_yuva);
- AVSC_DECLARE_FUNC(avs_is_planar_rgb);
- AVSC_DECLARE_FUNC(avs_is_planar_rgba);
AVSC_DECLARE_FUNC(avs_is_color_space);
AVSC_DECLARE_FUNC(avs_get_plane_width_subsampling);
@@ -935,14 +1024,73 @@ struct AVS_Library {
AVSC_DECLARE_FUNC(avs_is_writable);
AVSC_DECLARE_FUNC(avs_get_write_ptr_p);
+ // Avisynth+ specific
+ // Note: these functions are simulated/use fallback to existing functions
+ AVSC_DECLARE_FUNC(avs_is_rgb48);
+ AVSC_DECLARE_FUNC(avs_is_rgb64);
+ AVSC_DECLARE_FUNC(avs_is_yuv444p16);
+ AVSC_DECLARE_FUNC(avs_is_yuv422p16);
+ AVSC_DECLARE_FUNC(avs_is_yuv420p16);
+ AVSC_DECLARE_FUNC(avs_is_y16);
+ AVSC_DECLARE_FUNC(avs_is_yuv444ps);
+ AVSC_DECLARE_FUNC(avs_is_yuv422ps);
+ AVSC_DECLARE_FUNC(avs_is_yuv420ps);
+ AVSC_DECLARE_FUNC(avs_is_y32);
+ AVSC_DECLARE_FUNC(avs_is_444);
+ AVSC_DECLARE_FUNC(avs_is_422);
+ AVSC_DECLARE_FUNC(avs_is_420);
+ AVSC_DECLARE_FUNC(avs_is_y);
+ AVSC_DECLARE_FUNC(avs_is_yuva);
+ AVSC_DECLARE_FUNC(avs_is_planar_rgb);
+ AVSC_DECLARE_FUNC(avs_is_planar_rgba);
AVSC_DECLARE_FUNC(avs_num_components);
AVSC_DECLARE_FUNC(avs_component_size);
AVSC_DECLARE_FUNC(avs_bits_per_component);
+ // end of Avisynth+ specific
};
#undef AVSC_DECLARE_FUNC
+// Helper functions for fallback simulation
+// Avisynth+ extensions do not exist in classic Avisynth so they are simulated
+AVSC_INLINE int avs_is_xx_fallback_return_false(const AVS_VideoInfo * p)
+{
+ return 0;
+}
+
+// Avisynth+ extensions do not exist in classic Avisynth so they are simulated
+AVSC_INLINE int avs_num_components_fallback(const AVS_VideoInfo * p)
+{
+ switch (p->pixel_type) {
+ case AVS_CS_UNKNOWN:
+ return 0;
+ case AVS_CS_RAW32:
+ case AVS_CS_Y8:
+ return 1;
+ case AVS_CS_BGR32:
+ return 4; // not planar but return the count
+ default:
+ return 3;
+ }
+}
+
+// Avisynth+ extensions do not exist in classic Avisynth so they are simulated
+AVSC_INLINE int avs_component_size_fallback(const AVS_VideoInfo * p)
+{
+ return 1;
+}
+
+// Avisynth+ extensions do not exist in classic Avisynth so they are simulated
+AVSC_INLINE int avs_bits_per_component_fallback(const AVS_VideoInfo * p)
+{
+ return 8;
+}
+// End of helper functions for fallback simulation
+
+// avs_load_library() allocates an array for API procedure entries
+// reads and fills the entries with live procedure addresses.
+// AVSC_INLINE helpers which are calling into API procedures are not treated here (todo)
AVSC_INLINE AVS_Library * avs_load_library() {
AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
@@ -960,6 +1108,55 @@ AVSC_INLINE AVS_Library * avs_load_library() {
goto fail;\
}
+#if 0
+// FFmpeg-specific: we don't use the FALLBACK stuff, and it causes build errors,
+// so ifdef it out on our side.
+
+// When an API function is not loadable, let's try a replacement
+// Missing Avisynth+ functions will be substituted with classic Avisynth compatible methods
+/*
+Avisynth+ When method is missing (classic Avisynth)
+avs_is_rgb48 constant false
+avs_is_rgb64 constant false
+avs_is_yuv444p16 constant false
+avs_is_yuv422p16 constant false
+avs_is_yuv420p16 constant false
+avs_is_y16 constant false
+avs_is_yuv444ps constant false
+avs_is_yuv422ps constant false
+avs_is_yuv420ps constant false
+avs_is_y32 constant false
+avs_is_444 avs_is_yv24
+avs_is_422 avs_is_yv16
+avs_is_420 avs_is_yv12
+avs_is_y avs_is_y8
+avs_is_yuva constant false
+avs_is_planar_rgb constant false
+avs_is_planar_rgba constant false
+avs_num_components special: avs_num_components_fake Y8:1 RGB32:4 else 3
+avs_component_size constant 1 (1 bytes/component)
+avs_bits_per_component constant 8 (8 bits/component)
+*/
+
+ // try to load an alternative function
+#define AVSC_LOAD_FUNC_FALLBACK(name,name2) {\
+ library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\
+ if (library->name == NULL)\
+ library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name2));\
+ if (library->name == NULL)\
+ goto fail;\
+}
+
+ // try to assign a replacement function
+#define AVSC_LOAD_FUNC_FALLBACK_SIMULATED(name,name2) {\
+ library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\
+ if (library->name == NULL)\
+ library->name = name2;\
+ if (library->name == NULL)\
+ goto fail;\
+}
+#endif
+
AVSC_LOAD_FUNC(avs_add_function);
AVSC_LOAD_FUNC(avs_at_exit);
AVSC_LOAD_FUNC(avs_bit_blt);
@@ -999,28 +1196,11 @@ AVSC_INLINE AVS_Library * avs_load_library() {
AVSC_LOAD_FUNC(avs_vsprintf);
AVSC_LOAD_FUNC(avs_get_error);
- AVSC_LOAD_FUNC(avs_is_rgb48);
- AVSC_LOAD_FUNC(avs_is_rgb64);
AVSC_LOAD_FUNC(avs_is_yv24);
AVSC_LOAD_FUNC(avs_is_yv16);
AVSC_LOAD_FUNC(avs_is_yv12);
AVSC_LOAD_FUNC(avs_is_yv411);
AVSC_LOAD_FUNC(avs_is_y8);
- AVSC_LOAD_FUNC(avs_is_yuv444p16);
- AVSC_LOAD_FUNC(avs_is_yuv422p16);
- AVSC_LOAD_FUNC(avs_is_yuv420p16);
- AVSC_LOAD_FUNC(avs_is_y16);
- AVSC_LOAD_FUNC(avs_is_yuv444ps);
- AVSC_LOAD_FUNC(avs_is_yuv422ps);
- AVSC_LOAD_FUNC(avs_is_yuv420ps);
- AVSC_LOAD_FUNC(avs_is_y32);
- AVSC_LOAD_FUNC(avs_is_444);
- AVSC_LOAD_FUNC(avs_is_422);
- AVSC_LOAD_FUNC(avs_is_420);
- AVSC_LOAD_FUNC(avs_is_y);
- AVSC_LOAD_FUNC(avs_is_yuva);
- AVSC_LOAD_FUNC(avs_is_planar_rgb);
- AVSC_LOAD_FUNC(avs_is_planar_rgba);
AVSC_LOAD_FUNC(avs_is_color_space);
AVSC_LOAD_FUNC(avs_get_plane_width_subsampling);
@@ -1036,15 +1216,35 @@ AVSC_INLINE AVS_Library * avs_load_library() {
AVSC_LOAD_FUNC(avs_is_writable);
AVSC_LOAD_FUNC(avs_get_write_ptr_p);
- AVSC_LOAD_FUNC(avs_num_components);
- AVSC_LOAD_FUNC(avs_component_size);
- AVSC_LOAD_FUNC(avs_bits_per_component);
-
-
+#if 0
+ // Avisynth+ specific but made them callable for classic Avisynth hosts
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_rgb48, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_rgb64, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv444p16, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv422p16, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv420p16, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_y16, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv444ps, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv422ps, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv420ps, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_y32, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK(avs_is_444, avs_is_yv24);
+ AVSC_LOAD_FUNC_FALLBACK(avs_is_422, avs_is_yv16);
+ AVSC_LOAD_FUNC_FALLBACK(avs_is_420, avs_is_yv12);
+ AVSC_LOAD_FUNC_FALLBACK(avs_is_y, avs_is_y8);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuva, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_planar_rgb, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_planar_rgba, avs_is_xx_fallback_return_false);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_num_components, avs_num_components_fallback);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_component_size, avs_component_size_fallback);
+ AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_bits_per_component, avs_bits_per_component_fallback);
+#endif
#undef __AVSC_STRINGIFY
#undef AVSC_STRINGIFY
#undef AVSC_LOAD_FUNC
+#undef AVSC_LOAD_FUNC_FALLBACK
+#undef AVSC_LOAD_FUNC_FALLBACK_SIMULATED
return library;
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avs/capi.h b/chromium/third_party/ffmpeg/compat/avisynth/avs/capi.h
index 6ed6770c660..8799bf1fbbc 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avs/capi.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avs/capi.h
@@ -39,17 +39,49 @@
# define EXTERN_C
#endif
-#ifndef AVSC_USE_STDCALL
-# define AVSC_CC __cdecl
-#else
-# define AVSC_CC __stdcall
+#ifdef BUILDING_AVSCORE
+# if defined(GCC) && defined(X86_32)
+# define AVSC_CC
+# else // MSVC builds and 64-bit GCC
+# ifndef AVSC_USE_STDCALL
+# define AVSC_CC __cdecl
+# else
+# define AVSC_CC __stdcall
+# endif
+# endif
+#else // needed for programs that talk to AviSynth+
+# ifndef AVSC_WIN32_GCC32 // see comment below
+# ifndef AVSC_USE_STDCALL
+# define AVSC_CC __cdecl
+# else
+# define AVSC_CC __stdcall
+# endif
+# else
+# define AVSC_CC
+# endif
#endif
+// On 64-bit Windows, there's only one calling convention,
+// so there is no difference between MSVC and GCC. On 32-bit,
+// this isn't true. The convention that GCC needs to use to
+// even build AviSynth+ as 32-bit makes anything that uses
+// it incompatible with 32-bit MSVC builds of AviSynth+.
+// The AVSC_WIN32_GCC32 define is meant to provide a user
+// switchable way to make builds of FFmpeg to test 32-bit
+// GCC builds of AviSynth+ without having to screw around
+// with alternate headers, while still default to the usual
+// situation of using 32-bit MSVC builds of AviSynth+.
+
+// Hopefully, this situation will eventually be resolved
+// and a broadly compatible solution will arise so the
+// same 32-bit FFmpeg build can handle either MSVC or GCC
+// builds of AviSynth+.
+
#define AVSC_INLINE static __inline
#ifdef BUILDING_AVSCORE
-# define AVSC_EXPORT EXTERN_C
-# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
+# define AVSC_EXPORT __declspec(dllexport)
+# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name
#else
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
# ifndef AVSC_NO_DECLSPEC
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avs/config.h b/chromium/third_party/ffmpeg/compat/avisynth/avs/config.h
index 7acd95b57ec..a7d3e692ea4 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avs/config.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avs/config.h
@@ -42,7 +42,7 @@
// alignment. They should always request the exact alignment value they need.
// This is to make sure that plugins work over the widest range of AviSynth
// builds possible.
-#define FRAME_ALIGN 32
+#define FRAME_ALIGN 64
#if defined(_M_AMD64) || defined(__x86_64)
# define X86_64
@@ -52,4 +52,19 @@
# error Unsupported CPU architecture.
#endif
+#if defined(_MSC_VER)
+# define MSVC
+#elif defined(__GNUC__)
+# define GCC
+#elif defined(__clang__)
+# define CLANG
+#else
+# error Unsupported compiler.
+#endif
+
+#if defined(GCC)
+# undef __forceinline
+# define __forceinline inline
+#endif
+
#endif //AVS_CONFIG_H
diff --git a/chromium/third_party/ffmpeg/compat/avisynth/avs/types.h b/chromium/third_party/ffmpeg/compat/avisynth/avs/types.h
index e5f084cd336..df15f1d8e5c 100644
--- a/chromium/third_party/ffmpeg/compat/avisynth/avs/types.h
+++ b/chromium/third_party/ffmpeg/compat/avisynth/avs/types.h
@@ -35,6 +35,12 @@
// Define all types necessary for interfacing with avisynth.dll
+#ifdef __cplusplus
+ #include <cstddef>
+#else
+ #include <stddef.h>
+#endif
+
// Raster types used by VirtualDub & Avisynth
typedef unsigned int Pixel32;
typedef unsigned char BYTE;
diff --git a/chromium/third_party/ffmpeg/compat/cuda/ptx2c.sh b/chromium/third_party/ffmpeg/compat/cuda/ptx2c.sh
index 5ccabbf56f1..0750e7a3b78 100755
--- a/chromium/third_party/ffmpeg/compat/cuda/ptx2c.sh
+++ b/chromium/third_party/ffmpeg/compat/cuda/ptx2c.sh
@@ -27,7 +27,7 @@ IN="$2"
NAME="$(basename "$IN" | sed 's/\..*//')"
printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
-while read LINE
+while IFS= read -r LINE
do
printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT"
done < "$IN"
diff --git a/chromium/third_party/ffmpeg/compat/windows/makedef b/chromium/third_party/ffmpeg/compat/windows/makedef
index 7258b94a920..add8222d13f 100755
--- a/chromium/third_party/ffmpeg/compat/windows/makedef
+++ b/chromium/third_party/ffmpeg/compat/windows/makedef
@@ -48,7 +48,7 @@ trap 'rm -f -- $libname' EXIT
if [ -n "$AR" ]; then
$AR rcs ${libname} $@ >/dev/null
else
- lib -out:${libname} $@ >/dev/null
+ lib.exe -out:${libname} $@ >/dev/null
fi
if [ $? != 0 ]; then
echo "Could not create temporary library." >&2
@@ -108,7 +108,7 @@ if [ -n "$NM" ]; then
cut -d' ' -f3 |
sed -e "s/^${prefix}//")
else
- dump=$(dumpbin -linkermember:1 ${libname} |
+ dump=$(dumpbin.exe -linkermember:1 ${libname} |
sed -e '/public symbols/,$!d' -e '/^ \{1,\}Summary/,$d' -e "s/ \{1,\}${prefix}/ /" -e 's/ \{1,\}/ /g' |
tail -n +2 |
cut -d' ' -f3)
diff --git a/chromium/third_party/ffmpeg/configure b/chromium/third_party/ffmpeg/configure
index 972953ba7e8..ae1cd2d8f18 100755
--- a/chromium/third_party/ffmpeg/configure
+++ b/chromium/third_party/ffmpeg/configure
@@ -307,6 +307,7 @@ External library support:
--enable-opengl enable OpenGL rendering [no]
--enable-openssl enable openssl, needed for https support
if gnutls, libtls or mbedtls is not used [no]
+ --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
--disable-sndio disable sndio support [autodetect]
--disable-schannel disable SChannel SSP, needed for TLS support on
Windows if openssl and gnutls are not used [autodetect]
@@ -440,6 +441,7 @@ Optimization options (experts only):
--disable-mipsdsp disable MIPS DSP ASE R1 optimizations
--disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
--disable-msa disable MSA optimizations
+ --disable-msa2 disable MSA2 optimizations
--disable-mipsfpu disable floating point MIPS optimizations
--disable-mmi disable Loongson SIMD optimizations
--disable-fast-unaligned consider unaligned accesses slow
@@ -502,9 +504,13 @@ log(){
}
log_file(){
- log BEGIN $1
- pr -n -t $1 >> $logfile
- log END $1
+ log BEGIN "$1"
+ log_file_i=1
+ while IFS= read -r log_file_line; do
+ printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
+ log_file_i=$(($log_file_i+1))
+ done < "$1" >> "$logfile"
+ log END "$1"
}
warn(){
@@ -1799,6 +1805,7 @@ EXTERNAL_LIBRARY_LIST="
mediacodec
openal
opengl
+ pocketsphinx
vapoursynth
"
@@ -1993,6 +2000,7 @@ ARCH_EXT_LIST_MIPS="
mipsdsp
mipsdspr2
msa
+ msa2
"
ARCH_EXT_LIST_LOONGSON="
@@ -2521,6 +2529,7 @@ mipsdsp_deps="mips"
mipsdspr2_deps="mips"
mmi_deps="mips"
msa_deps="mipsfpu"
+msa2_deps="msa"
cpunop_deps="i686"
x86_64_select="i686"
@@ -2580,8 +2589,8 @@ threads_if_any="$THREADS_LIST"
# subsystems
cbs_av1_select="cbs"
-cbs_h264_select="cbs golomb"
-cbs_h265_select="cbs golomb"
+cbs_h264_select="cbs"
+cbs_h265_select="cbs"
cbs_jpeg_select="cbs"
cbs_mpeg2_select="cbs"
cbs_vp9_select="cbs"
@@ -2819,6 +2828,7 @@ vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="audio_frame_queue mdct"
vp3_decoder_select="hpeldsp vp3dsp videodsp"
+vp4_decoder_select="vp3_decoder"
vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
vp6a_decoder_select="vp6_decoder"
@@ -3089,7 +3099,6 @@ hevc_metadata_bsf_select="cbs_h265"
mjpeg2jpeg_bsf_select="jpegtables"
mpeg2_metadata_bsf_select="cbs_mpeg2"
trace_headers_bsf_select="cbs"
-truehd_core_bsf_select="mlp_parser"
vp9_metadata_bsf_select="cbs_vp9"
# external libraries
@@ -3401,6 +3410,7 @@ afir_filter_deps="avcodec"
afir_filter_select="fft"
amovie_filter_deps="avcodec avformat"
aresample_filter_deps="swresample"
+asr_filter_deps="pocketsphinx"
ass_filter_deps="libass"
atempo_filter_deps="avcodec"
atempo_filter_select="rdft"
@@ -3429,6 +3439,7 @@ deinterlace_qsv_filter_deps="libmfx"
deinterlace_vaapi_filter_deps="vaapi"
delogo_filter_deps="gpl"
denoise_vaapi_filter_deps="vaapi"
+derain_filter_select="dnn"
deshake_filter_select="pixelutils"
dilation_opencl_filter_deps="opencl"
drawtext_filter_deps="libfreetype"
@@ -3464,6 +3475,7 @@ mpdecimate_filter_select="pixelutils"
minterpolate_filter_select="scene_sad"
mptestsrc_filter_deps="gpl"
negate_filter_deps="lut_filter"
+nlmeans_opencl_filter_deps="opencl"
nnedi_filter_deps="gpl"
ocr_filter_deps="libtesseract"
ocv_filter_deps="libopencv"
@@ -3742,6 +3754,8 @@ mkdir -p ffbuild
# find source path
if test -f configure; then
source_path=.
+elif test -f src/configure; then
+ source_path=src
else
source_path=$(cd $(dirname "$0"); pwd)
case "$source_path" in
@@ -3832,8 +3846,22 @@ die_unknown(){
}
print_in_columns() {
- cols=$(expr $ncols / 24)
- cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
+ tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
+ {
+ num_cols = width > col_width ? int(width / col_width) : 1;
+ num_rows = int((NF + num_cols-1) / num_cols);
+ y = x = 1;
+ for (y = 1; y <= num_rows; y++) {
+ i = y;
+ for (x = 1; x <= num_cols; x++) {
+ if (i <= NF) {
+ line = sprintf("%s%-" col_width "s", line, $i);
+ }
+ i = i + num_rows;
+ }
+ print line; line = "";
+ }
+ }' | sed 's/ *$//'
}
show_list() {
@@ -5463,6 +5491,7 @@ probe_libc(){
add_${pfx}cppflags -D__printf__=__gnu_printf__
test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
add_${pfx}cppflags -D_WIN32_WINNT=0x0600
+ add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
eval ${pfx}libc_type=mingw32
@@ -5476,6 +5505,7 @@ probe_libc(){
add_${pfx}cppflags -D_WIN32_WINNT=0x0600
eval test \$${pfx_no_}cc_type = "gcc" &&
add_${pfx}cppflags -D__printf__=__gnu_printf__
+ add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
eval ${pfx}libc_type=msvcrt
if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
@@ -5731,6 +5761,7 @@ elif enabled mips; then
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_headers msa.h || disable msa
enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
+ enabled msa && enabled msa2 && check_inline_asm_flags msa2 '"nxbits.any.b $w0, $w0"' '-mmsa2' && check_headers msa2.h || disable msa2
if enabled bigendian && enabled msa; then
disable msa
@@ -6301,6 +6332,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
{ enabled libdrm ||
@@ -6520,6 +6552,14 @@ if enabled x86; then
disable ffnvcodec cuvid nvdec nvenc
;;
esac
+elif enabled ppc64 && ! enabled bigendian; then
+ case $target_os in
+ linux)
+ ;;
+ *)
+ disable ffnvcodec cuvid nvdec nvenc
+ ;;
+ esac
else
disable ffnvcodec cuvid nvdec nvenc
fi
@@ -7102,6 +7142,7 @@ if enabled mips; then
echo "MIPS DSP R1 enabled ${mipsdsp-no}"
echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
echo "MIPS MSA enabled ${msa-no}"
+ echo "MIPS MSA2 enabled ${msa2-no}"
echo "LOONGSON MMI enabled ${mmi-no}"
fi
if enabled ppc; then
diff --git a/chromium/third_party/ffmpeg/doc/APIchanges b/chromium/third_party/ffmpeg/doc/APIchanges
index e75c4044ce2..b5fadc2a48b 100644
--- a/chromium/third_party/ffmpeg/doc/APIchanges
+++ b/chromium/third_party/ffmpeg/doc/APIchanges
@@ -15,6 +15,15 @@ libavutil: 2017-10-21
API changes, most recent first:
+2019-06-21 - XXXXXXXXXX - lavu 56.30.100 - frame.h
+ Add FF_DECODE_ERROR_DECODE_SLICES
+
+2019-06-14 - XXXXXXXXXX - lavu 56.29.100 - frame.h
+ Add FF_DECODE_ERROR_CONCEALMENT_ACTIVE
+
+2019-05-15 - b79b29ddb1 - lavu 56.28.100 - tx.h
+ Add av_tx_init(), av_tx_uninit() and related definitions.
+
2019-04-20 - 3153a6502a - lavc 58.52.100 - avcodec.h
Add AV_CODEC_FLAG_DROPCHANGED to allow avcodec_receive_frame to drop
frames whose parameters differ from first decoded frame in stream.
diff --git a/chromium/third_party/ffmpeg/doc/bitstream_filters.texi b/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
index 25bbf8372b7..a6a5a331f57 100644
--- a/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
+++ b/chromium/third_party/ffmpeg/doc/bitstream_filters.texi
@@ -120,7 +120,7 @@ add extradata to all packets
@end table
@end table
-If not specified it is assumed @samp{e}.
+If not specified it is assumed @samp{k}.
For example the following @command{ffmpeg} command forces a global
header (thus disabling individual packet headers) in the H.264 packets
@@ -361,6 +361,15 @@ will replace the current ones if the stream is already cropped.
These fields are set in pixels. Note that some sizes may not be
representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
+@item level
+Set the level in the VPS and SPS. See H.265 section A.4 and tables
+A.6 and A.7.
+
+The argument must be the name of a level (for example, @samp{5.1}), a
+@emph{general_level_idc} value (for example, @samp{153} for level 5.1),
+or the special name @samp{auto} indicating that the filter should
+attempt to guess the level from the input stream properties.
+
@end table
@section hevc_mp4toannexb
diff --git a/chromium/third_party/ffmpeg/doc/build_system.txt b/chromium/third_party/ffmpeg/doc/build_system.txt
index 325a9e83d01..3d6a21a9f3f 100644
--- a/chromium/third_party/ffmpeg/doc/build_system.txt
+++ b/chromium/third_party/ffmpeg/doc/build_system.txt
@@ -36,11 +36,11 @@ install
examples
Build all examples located in doc/examples.
-libavformat/output-example
- Build the libavformat basic example.
+checkheaders
+ Check headers dependencies.
-libswscale/swscale-test
- Build the swscale self-test (useful also as an example).
+alltools
+ Build all tools in tools directory.
config
Reconfigure the project with the current configuration.
diff --git a/chromium/third_party/ffmpeg/doc/decoders.texi b/chromium/third_party/ffmpeg/doc/decoders.texi
index 704bd60b9f1..0582b018b09 100644
--- a/chromium/third_party/ffmpeg/doc/decoders.texi
+++ b/chromium/third_party/ffmpeg/doc/decoders.texi
@@ -47,6 +47,32 @@ top-field-first is assumed
@end table
+@section libdav1d
+
+dav1d AV1 decoder.
+
+libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
+Requires the presence of the libdav1d headers and library during configuration.
+You need to explicitly configure the build with @code{--enable-libdav1d}.
+
+@subsection Options
+
+The following option is supported by the libdav1d wrapper.
+
+@table @option
+
+@item framethreads
+Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
+
+@item tilethreads
+Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
+
+@item filmgrain
+Apply film grain to the decoded video if present in the bitstream. The default value
+is true.
+
+@end table
+
@section libdavs2
AVS2-P2/IEEE1857.4 video decoder wrapper.
diff --git a/chromium/third_party/ffmpeg/doc/encoders.texi b/chromium/third_party/ffmpeg/doc/encoders.texi
index ef12c73ed54..eefd124751f 100644
--- a/chromium/third_party/ffmpeg/doc/encoders.texi
+++ b/chromium/third_party/ffmpeg/doc/encoders.texi
@@ -733,6 +733,14 @@ if set to 0.
Default value is 0.
+@item eld_v2
+Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
+disabled if set to 0.
+
+Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) > (4.0.0).
+
+Default value is 0.
+
@item signaling
Set SBR/PS signaling style.
diff --git a/chromium/third_party/ffmpeg/doc/examples/avio_reading.c b/chromium/third_party/ffmpeg/doc/examples/avio_reading.c
index cbfeb174b8c..36ee02afa54 100644
--- a/chromium/third_party/ffmpeg/doc/examples/avio_reading.c
+++ b/chromium/third_party/ffmpeg/doc/examples/avio_reading.c
@@ -117,11 +117,12 @@ int main(int argc, char *argv[])
end:
avformat_close_input(&fmt_ctx);
+
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
- if (avio_ctx) {
+ if (avio_ctx)
av_freep(&avio_ctx->buffer);
- av_freep(&avio_ctx);
- }
+ avio_context_free(&avio_ctx);
+
av_file_unmap(buffer, buffer_size);
if (ret < 0) {
diff --git a/chromium/third_party/ffmpeg/doc/ffplay.texi b/chromium/third_party/ffmpeg/doc/ffplay.texi
index c3054650788..a487c0de8d0 100644
--- a/chromium/third_party/ffmpeg/doc/ffplay.texi
+++ b/chromium/third_party/ffmpeg/doc/ffplay.texi
@@ -66,6 +66,8 @@ Set custom interval, in seconds, for seeking using left/right keys. Default is 1
Disable graphical display.
@item -noborder
Borderless window.
+@item -alwaysontop
+Window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6.
@item -volume
Set the startup volume. 0 means silence, 100 means no volume reduction or
amplification. Negative values are treated as 0, values above 100 are treated
diff --git a/chromium/third_party/ffmpeg/doc/ffprobe.xsd b/chromium/third_party/ffmpeg/doc/ffprobe.xsd
index 3e58da0f46f..97dc67def6d 100644
--- a/chromium/third_party/ffmpeg/doc/ffprobe.xsd
+++ b/chromium/third_party/ffmpeg/doc/ffprobe.xsd
@@ -147,11 +147,25 @@
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="frameSideDataType">
+ <xsd:sequence>
+ <xsd:element name="timecodes" type="ffprobe:frameSideDataTimecodeList" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+
<xsd:attribute name="side_data_type" type="xsd:string"/>
<xsd:attribute name="side_data_size" type="xsd:int" />
<xsd:attribute name="timecode" type="xsd:string"/>
</xsd:complexType>
+ <xsd:complexType name="frameSideDataTimecodeList">
+ <xsd:sequence>
+ <xsd:element name="timecode" type="ffprobe:frameSideDataTimecodeType" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="frameSideDataTimecodeType">
+ <xsd:attribute name="value" type="xsd:string"/>
+ </xsd:complexType>
+
<xsd:complexType name="subtitleType">
<xsd:attribute name="media_type" type="xsd:string" fixed="subtitle" use="required"/>
<xsd:attribute name="pts" type="xsd:long" />
diff --git a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
index e75bec43547..1234de850e9 100644
--- a/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
+++ b/chromium/third_party/ffmpeg/doc/fftools-common-opts.texi
@@ -36,7 +36,10 @@ Possible forms of stream specifiers are:
Matches the stream with this index. E.g. @code{-threads:1 4} would set the
thread count for the second stream to 4. If @var{stream_index} is used as an
additional stream specifier (see below), then it selects stream number
-@var{stream_index} from the matching streams.
+@var{stream_index} from the matching streams. Stream numbering is based on the
+order of the streams as detected by libavformat except when a program ID is
+also specified. In this case it is based on the ordering of the streams in the
+program.
@item @var{stream_type}[:@var{additional_stream_specifier}]
@var{stream_type} is one of following: 'v' or 'V' for video, 'a' for audio, 's'
for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video
@@ -106,6 +109,10 @@ Print detailed information about the muxer named @var{muxer_name}. Use the
@item filter=@var{filter_name}
Print detailed information about the filter name @var{filter_name}. Use the
@option{-filters} option to get a list of all filters.
+
+@item bsf=@var{bitstream_filter_name}
+Print detailed information about the bitstream filter name @var{bitstream_filter_name}.
+Use the @option{-bsfs} option to get a list of all bitstream filters.
@end table
@item -version
diff --git a/chromium/third_party/ffmpeg/doc/filters.texi b/chromium/third_party/ffmpeg/doc/filters.texi
index 6ce2781c199..c92ed8de074 100644
--- a/chromium/third_party/ffmpeg/doc/filters.texi
+++ b/chromium/third_party/ffmpeg/doc/filters.texi
@@ -1124,25 +1124,8 @@ Return the value of imaginary part of frequency bin at location (@var{bin},@var{
@end table
@item win_size
-Set window size.
-
-It accepts the following values:
-@table @samp
-@item w16
-@item w32
-@item w64
-@item w128
-@item w256
-@item w512
-@item w1024
-@item w2048
-@item w4096
-@item w8192
-@item w16384
-@item w32768
-@item w65536
-@end table
-Default is @code{w4096}
+Set window size. Allowed range is from 16 to 131072.
+Default is @code{4096}
@item win_func
Set window function. Default is @code{hann}.
@@ -1409,6 +1392,10 @@ single-precision floating-point
16-bit integers
@end table
+@item mix
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item response
Show IR frequency response, magnitude and phase in additional video stream.
By default it is disabled.
@@ -1523,6 +1510,10 @@ kHz
@item width, w
Specify the band-width of a filter in width_type units.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -1542,6 +1533,10 @@ Syntax for the command is : "@var{width_type}"
@item width, w
Change allpass width.
Syntax for the command is : "@var{width}"
+
+@item mix, m
+Change allpass mix.
+Syntax for the command is : "@var{mix}"
@end table
@section aloop
@@ -1801,6 +1796,22 @@ Pass only noise.
Default value is @var{o}.
@end table
+
+@item m
+Set smooth factor. Default value is @var{11}. Allowed range is from @var{1} to @var{15}.
+@end table
+
+@subsection Commands
+
+This filter supports the following commands:
+@table @option
+@item s
+Change denoise strength. Argument is single float number.
+Syntax for the command is : "@var{s}"
+
+@item o
+Change output mode.
+Syntax for the command is : "i", "o" or "n" string.
@end table
@section anull
@@ -2104,6 +2115,68 @@ audio, the data is treated as if all the planes were concatenated.
A list of Adler-32 checksums for each data plane.
@end table
+@section asoftclip
+Apply audio soft clipping.
+
+Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
+along a smooth curve, rather than the abrupt shape of hard-clipping.
+
+This filter accepts the following options:
+
+@table @option
+@item type
+Set type of soft-clipping.
+
+It accepts the following values:
+@table @option
+@item tanh
+@item atan
+@item cubic
+@item exp
+@item alg
+@item quintic
+@item sin
+@end table
+
+@item param
+Set additional parameter which controls sigmoid function.
+@end table
+
+@section asr
+Automatic Speech Recognition
+
+This filter uses PocketSphinx for speech recognition. To enable
+compilation of this filter, you need to configure FFmpeg with
+@code{--enable-pocketsphinx}.
+
+It accepts the following options:
+
+@table @option
+@item rate
+Set sampling rate of input audio. Defaults is @code{16000}.
+This need to match speech models, otherwise one will get poor results.
+
+@item hmm
+Set dictionary containing acoustic model files.
+
+@item dict
+Set pronunciation dictionary.
+
+@item lm
+Set language model file.
+
+@item lmctl
+Set language model set.
+
+@item lmname
+Set which language model to use.
+
+@item logfn
+Set output for log messages.
+@end table
+
+The filter exports recognized speech as the frame metadata @code{lavfi.asr.text}.
+
@anchor{astats}
@section astats
@@ -2141,6 +2214,9 @@ Bit_depth
Dynamic_range
Zero_crossings
Zero_crossings_rate
+Number_of_NaNs
+Number_of_Infs
+Number_of_denormals
and for Overall:
DC_offset
@@ -2158,6 +2234,9 @@ Flat_factor
Peak_count
Bit_depth
Number_of_samples
+Number_of_NaNs
+Number_of_Infs
+Number_of_denormals
For example full key look like this @code{lavfi.astats.1.DC_offset} or
this @code{lavfi.astats.Overall.Peak_count}.
@@ -2376,6 +2455,10 @@ kHz
@item width, w
Specify the band-width of a filter in width_type units.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -2395,6 +2478,10 @@ Syntax for the command is : "@var{width_type}"
@item width, w
Change bandpass width.
Syntax for the command is : "@var{width}"
+
+@item mix, m
+Change bandpass mix.
+Syntax for the command is : "@var{mix}"
@end table
@section bandreject
@@ -2427,6 +2514,10 @@ kHz
@item width, w
Specify the band-width of a filter in width_type units.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -2446,6 +2537,10 @@ Syntax for the command is : "@var{width_type}"
@item width, w
Change bandreject width.
Syntax for the command is : "@var{width}"
+
+@item mix, m
+Change bandreject mix.
+Syntax for the command is : "@var{mix}"
@end table
@section bass, lowshelf
@@ -2485,6 +2580,10 @@ kHz
@item width, w
Determine how steep is the filter's shelf transition.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -2508,6 +2607,10 @@ Syntax for the command is : "@var{width}"
@item gain, g
Change bass gain.
Syntax for the command is : "@var{gain}"
+
+@item mix, m
+Change bass mix.
+Syntax for the command is : "@var{mix}"
@end table
@section biquad
@@ -2530,6 +2633,10 @@ This filter supports the following commands:
@item b2
Change biquad parameter.
Syntax for the command is : "@var{value}"
+
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
@end table
@section bs2b
@@ -2961,6 +3068,42 @@ Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
used to prevent clipping.
@end table
+@section deesser
+
+Apply de-essing to the audio samples.
+
+@table @option
+@item i
+Set intensity for triggering de-essing. Allowed range is from 0 to 1.
+Default is 0.
+
+@item m
+Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
+Default is 0.5.
+
+@item f
+How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
+Default is 0.5.
+
+@item s
+Set the output mode.
+
+It accepts the following values:
+@table @option
+@item i
+Pass input unchanged.
+
+@item o
+Pass ess filtered out.
+
+@item e
+Pass only ess.
+
+Default value is @var{o}.
+@end table
+
+@end table
+
@section drmeter
Measure audio dynamic range.
@@ -3183,6 +3326,10 @@ Specify the band-width of a filter in width_type units.
Set the required gain or attenuation in dB.
Beware of clipping when using a positive gain.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -3221,6 +3368,10 @@ Syntax for the command is : "@var{width}"
@item gain, g
Change equalizer gain.
Syntax for the command is : "@var{gain}"
+
+@item mix, m
+Change equalizer mix.
+Syntax for the command is : "@var{mix}"
@end table
@section extrastereo
@@ -3644,6 +3795,10 @@ Specify the band-width of a filter in width_type units.
Applies only to double-pole filter.
The default is 0.707q and gives a Butterworth response.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -3663,6 +3818,10 @@ Syntax for the command is : "@var{width_type}"
@item width, w
Change highpass width.
Syntax for the command is : "@var{width}"
+
+@item mix, m
+Change highpass mix.
+Syntax for the command is : "@var{mix}"
@end table
@section join
@@ -3952,6 +4111,10 @@ Specify the band-width of a filter in width_type units.
Applies only to double-pole filter.
The default is 0.707q and gives a Butterworth response.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -3980,6 +4143,10 @@ Syntax for the command is : "@var{width_type}"
@item width, w
Change lowpass width.
Syntax for the command is : "@var{width}"
+
+@item mix, m
+Change lowpass mix.
+Syntax for the command is : "@var{mix}"
@end table
@section lv2
@@ -4877,12 +5044,58 @@ In @var{add} mode, LFE channel is created from input audio and added to output.
In @var{sub} mode, LFE channel is created from input audio and added to output but
also all non-LFE output channels are subtracted with output LFE channel.
+@item angle
+Set angle of stereo surround transform, Allowed range is from @var{0} to @var{360}.
+Default is @var{90}.
+
@item fc_in
Set front center input volume. By default, this is @var{1}.
@item fc_out
Set front center output volume. By default, this is @var{1}.
+@item fl_in
+Set front left input volume. By default, this is @var{1}.
+
+@item fl_out
+Set front left output volume. By default, this is @var{1}.
+
+@item fr_in
+Set front right input volume. By default, this is @var{1}.
+
+@item fr_out
+Set front right output volume. By default, this is @var{1}.
+
+@item sl_in
+Set side left input volume. By default, this is @var{1}.
+
+@item sl_out
+Set side left output volume. By default, this is @var{1}.
+
+@item sr_in
+Set side right input volume. By default, this is @var{1}.
+
+@item sr_out
+Set side right output volume. By default, this is @var{1}.
+
+@item bl_in
+Set back left input volume. By default, this is @var{1}.
+
+@item bl_out
+Set back left output volume. By default, this is @var{1}.
+
+@item br_in
+Set back right input volume. By default, this is @var{1}.
+
+@item br_out
+Set back right output volume. By default, this is @var{1}.
+
+@item bc_in
+Set back center input volume. By default, this is @var{1}.
+
+@item bc_out
+Set back center output volume. By default, this is @var{1}.
+
@item lfe_in
Set LFE input volume. By default, this is @var{1}.
@@ -4901,6 +5114,9 @@ Set spread usage of stereo image across X axis for each channel.
@item fcy, fly, fry, bly, bry, sly, sry, bcy
Set spread usage of stereo image across Y axis for each channel.
+@item win_size
+Set window size. Allowed range is from @var{1024} to @var{65536}. Default size is @var{4096}.
+
@item win_func
Set window function.
@@ -4971,6 +5187,10 @@ kHz
@item width, w
Determine how steep is the filter's shelf transition.
+@item mix, m
+How much to use filtered signal in output. Default is 1.
+Range is between 0 and 1.
+
@item channels, c
Specify which channels to filter, by default all available are filtered.
@end table
@@ -4994,6 +5214,10 @@ Syntax for the command is : "@var{width}"
@item gain, g
Change treble gain.
Syntax for the command is : "@var{gain}"
+
+@item mix, m
+Change treble mix.
+Syntax for the command is : "@var{mix}"
@end table
@section tremolo
@@ -6367,6 +6591,11 @@ The color which will not be replaced with neutral chroma.
Similarity percentage with the above color.
0.01 matches only the exact key color, while 1.0 matches everything.
+@item blend
+Blend percentage.
+0.0 makes pixels either fully gray, or not gray at all.
+Higher values result in more preserved color.
+
@item yuv
Signals that the color passed is already in YUV instead of RGB.
@@ -6641,6 +6870,24 @@ ffmpeg -i background.png -i video.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.
@end example
@end itemize
+@section colorhold
+Remove all color information for all RGB colors except for certain one.
+
+The filter accepts the following options:
+
+@table @option
+@item color
+The color which will not be replaced with neutral gray.
+
+@item similarity
+Similarity percentage with the above color.
+0.01 matches only the exact key color, while 1.0 matches everything.
+
+@item blend
+Blend percentage. 0.0 makes pixels fully gray.
+Higher values result in more preserved color.
+@end table
+
@section colorlevels
Adjust video input frames using levels.
@@ -8108,6 +8355,40 @@ delogo=x=0:y=0:w=100:h=77:band=10
@end itemize
+@section derain
+
+Remove the rain in the input image/video by applying the derain methods based on
+convolutional neural networks. Supported models:
+
+@itemize
+@item
+Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
+See @url{http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf}.
+@end itemize
+
+Training scripts as well as scripts for model generation are provided in
+the repository at @url{https://github.com/XueweiMeng/derain_filter.git}.
+
+The filter accepts the following options:
+
+@table @option
+@item dnn_backend
+Specify which DNN backend to use for model loading and execution. This option accepts
+the following values:
+
+@table @samp
+@item native
+Native implementation of DNN loading and execution.
+@end table
+Default value is @samp{native}.
+
+@item model
+Set path to model file specifying network architecture and its parameters.
+Note that different backends use different file formats. TensorFlow backend
+can load files for both formats, while native backend can load files for only
+its format.
+@end table
+
@section deshake
Attempt to fix small changes in horizontal and/or vertical shift. This
@@ -8772,7 +9053,21 @@ the width of the rendered text
the x and y offset coordinates where the text is drawn.
These parameters allow the @var{x} and @var{y} expressions to refer
-each other, so you can for example specify @code{y=x/dar}.
+to each other, so you can for example specify @code{y=x/dar}.
+
+@item pict_type
+A one character description of the current frame's picture type.
+
+@item pkt_pos
+The current packet's position in the input file or stream
+(in bytes, from the start of the input). A value of -1 indicates
+this info is not available.
+
+@item pkt_duration
+The current packet's duration, in seconds.
+
+@item pkt_size
+The current packet's size (in bytes).
@end table
@anchor{drawtext_expansion}
@@ -8842,11 +9137,18 @@ The first argument is mandatory and specifies the metadata key.
The second argument is optional and specifies a default value, used when the
metadata key is not found or empty.
+Available metadata can be identified by inspecting entries
+starting with TAG included within each frame section
+printed by running @code{ffprobe -show_frames}.
+
+String metadata generated in filters leading to
+the drawtext filter are also available.
+
@item n, frame_num
The frame number, starting from 0.
@item pict_type
-A 1 character description of the current picture type.
+A one character description of the current picture type.
@item pts
The timestamp of the current frame.
@@ -8870,6 +9172,29 @@ a third argument may be supplied: a strftime() format string.
By default, @var{YYYY-MM-DD HH:MM:SS} format will be used.
@end table
+@subsection Commands
+
+This filter supports altering parameters via commands:
+@table @option
+@item reinit
+Alter existing filter parameters.
+
+Syntax for the argument is the same as for filter invocation, e.g.
+
+@example
+fontsize=56:fontcolor=green:text='Hello World'
+@end example
+
+Full filter invocation with sendcmd would look like this:
+
+@example
+sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
+@end example
+@end table
+
+If the entire argument can't be parsed or applied as valid values then the filter will
+continue with its existing parameters.
+
@subsection Examples
@itemize
@@ -9953,7 +10278,7 @@ Specifies the rectangle in which to search.
@itemize
@item
-Generate a representative palette of a given video using @command{ffmpeg}:
+Cover a rectangular object by the supplied image of a given video using @command{ffmpeg}:
@example
ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
@end example
@@ -9987,7 +10312,7 @@ Default value is @var{blur}.
@itemize
@item
-Generate a representative palette of a given video using @command{ffmpeg}:
+Cover a rectangular object by the supplied image of a given video using @command{ffmpeg}:
@example
ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
@end example
@@ -10681,6 +11006,8 @@ Default is @code{1}.
@code{haldclut} also has the same interpolation options as @ref{lut3d} (both
filters share the same internals).
+This filter also supports the @ref{framesync} options.
+
More information about the Hald CLUT can be found on Eskil Steenberg's website
(Hald CLUT author) at @url{http://www.quelsolaar.com/technology/clut.html}.
@@ -11766,8 +12093,6 @@ Interpolate values using a tetrahedron.
@end table
@end table
-This filter also supports the @ref{framesync} options.
-
@section lumakey
Turn certain luma values into transparency.
@@ -12747,6 +13072,7 @@ Set character blacklist.
@end table
The filter exports recognized text as the frame metadata @code{lavfi.ocr.text}.
+The filter exports confidence of recognized words as the frame metadata @code{lavfi.ocr.confidence}.
@section ocv
@@ -14346,6 +14672,9 @@ Set the black color threshold. Default is @code{0.15}. Allowed range is @code{[0
@item chp
Enable checking the parity bit. In the event of a parity error, the filter will output
@code{0x00} for that character. Default is false.
+
+@item lp
+Lowpass lines prior further proccessing. Default is disabled.
@end table
@subsection Examples
@@ -14891,6 +15220,8 @@ Set color space conforming to the United States Federal Communications
Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
@item bt601
+@item bt470
+@item smpte170m
Set color space conforming to:
@itemize
@@ -14907,6 +15238,9 @@ Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
@item smpte240m
Set color space conforming to SMPTE ST 240:1999.
+
+@item bt2020
+Set color space conforming to ITU-R BT.2020 non-constant luminance system.
@end table
@item in_range
@@ -15188,6 +15522,12 @@ Scale a subtitle stream (b) to match the main video (a) in size before overlayin
@example
'scale2ref[b][a];[a][b]overlay'
@end example
+
+@item
+Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
+@example
+[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
+@end example
@end itemize
@anchor{selectivecolor}
@@ -16368,8 +16708,12 @@ Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
See @url{https://arxiv.org/abs/1609.05158}.
@end itemize
-Training scripts as well as scripts for model generation are provided in
-the repository at @url{https://github.com/HighVoltageRocknRoll/sr.git}.
+Training scripts as well as scripts for model file (.pb) saving can be found at
+@url{https://github.com/XueweiMeng/sr/tree/sr_dnn_native}. Original repository
+is at @url{https://github.com/HighVoltageRocknRoll/sr.git}.
+
+Native model files (.model) can be generated from TensorFlow model
+files (.pb) by using tools/python/convert.py
The filter accepts the following options:
@@ -16945,14 +17289,14 @@ Specify flags influencing the filter process.
Available value for @var{flags} is:
@table @option
-@item low_pass_filter, vlfp
+@item low_pass_filter, vlpf
Enable linear vertical low-pass filtering in the filter.
Vertical low-pass filtering is required when creating an interlaced
destination from a progressive source which contains high-frequency
vertical detail. Filtering will reduce interlace 'twitter' and Moire
patterning.
-@item complex_filter, cvlfp
+@item complex_filter, cvlpf
Enable complex vertical low-pass filtering.
This will slightly less reduce interlace 'twitter' and Moire
patterning but better retain detail and subjective sharpness impression.
@@ -17902,6 +18246,10 @@ Set the green luma coefficient.
@item blum
Set the blue luma coefficient.
+
+@item alternate
+If @code{intensity} is negative and this is set to 1, colors will change,
+otherwise colors will be less saturated, more towards gray.
@end table
@anchor{vignette}
@@ -18058,6 +18406,10 @@ implemented based on the de-interlace algorithm written by Jim
Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter
uses filter coefficients calculated by BBC R&D.
+This filter use field-dominance information in frame to decide which
+of each pair of fields to place first in the output.
+If it gets it wrong use @ref{setfield} filter before @code{w3fdif} filter.
+
There are two sets of filter coefficients, so called "simple":
and "complex". Which set of filter coefficients is used can
be set by passing an optional parameter:
@@ -18280,6 +18632,21 @@ Set the scaling dimension: @code{2} for @code{2xBR}, @code{3} for
Default is @code{3}.
@end table
+@section xmedian
+Pick median pixels from several input videos.
+
+The filter accept the following options:
+
+@table @option
+@item inputs
+Set number of inputs.
+Default is 3. Allowed range is from 3 to 255.
+If number of inputs is even number, than result will be mean value between two median values.
+
+@item planes
+Set which planes to filter. Default value is @code{15}, by which all planes are processed.
+@end table
+
@section xstack
Stack video inputs into custom layout.
@@ -18302,6 +18669,9 @@ where X is video input from which to take width or height.
Multiple values can be used when separated by '+'. In such
case values are summed together.
+For 2 inputs, a default layout of @code{0_0|w0_0} is set. In all other cases,
+a layout must be set by the user.
+
@item shortest
If set to 1, force the output to terminate when the shortest input
terminates. Default value is 0.
@@ -19154,6 +19524,10 @@ Make every semi-green pixel in the input transparent with some slight blending:
@end example
@end itemize
+@section nlmeans_opencl
+
+Non-local Means denoise filter through OpenCL, this filter accepts same options as @ref{nlmeans}.
+
@section overlay_opencl
Overlay one video on top of another.
@@ -21054,6 +21428,14 @@ They accept the following options:
@item limit
Time limit for the pauses. Any pause longer than that will be considered
a timestamp discontinuity and reset the timer. Default is 2 seconds.
+@item speed
+Speed factor for processing. The value must be a float larger than zero.
+Values larger than 1.0 will result in faster than realtime processing,
+smaller will slow processing down. The @var{limit} is automatically adapted
+accordingly. Default is 1.0.
+
+A processing speed faster than what is possible without these filters cannot
+be achieved.
@end table
@anchor{select}
@@ -21964,25 +22346,9 @@ Reverse logarithmic scale.
Default is @code{lin}.
@item win_size
-Set window size.
+Set window size. Allowed range is from 16 to 65536.
-It accepts the following values:
-@table @samp
-@item w16
-@item w32
-@item w64
-@item w128
-@item w256
-@item w512
-@item w1024
-@item w2048
-@item w4096
-@item w8192
-@item w16384
-@item w32768
-@item w65536
-@end table
-Default is @code{w2048}
+Default is @code{2048}
@item win_func
Set windowing function.
@@ -22040,6 +22406,58 @@ Set minimum amplitude used in @code{log} amplitude scaler.
@end table
+@section showspatial
+
+Convert stereo input audio to a video output, representing the spatial relationship
+between two channels.
+
+The filter accepts the following options:
+
+@table @option
+@item size, s
+Specify the video size for the output. For the syntax of this option, check the
+@ref{video size syntax,,"Video size" section in the ffmpeg-utils manual,ffmpeg-utils}.
+Default value is @code{512x512}.
+
+@item win_size
+Set window size. Allowed range is from @var{1024} to @var{65536}. Default size is @var{4096}.
+
+@item win_func
+Set window function.
+
+It accepts the following values:
+@table @samp
+@item rect
+@item bartlett
+@item hann
+@item hanning
+@item hamming
+@item blackman
+@item welch
+@item flattop
+@item bharris
+@item bnuttall
+@item bhann
+@item sine
+@item nuttall
+@item lanczos
+@item gauss
+@item tukey
+@item dolph
+@item cauchy
+@item parzen
+@item poisson
+@item bohman
+@end table
+
+Default value is @code{hann}.
+
+@item overlap
+Set ratio of overlap window. Default value is @code{0.5}.
+When value is @code{1} overlap is set to recommended size for specific
+window function currently used.
+@end table
+
@anchor{showspectrum}
@section showspectrum
@@ -22144,6 +22562,19 @@ logarithmic
Default value is @samp{sqrt}.
+@item fscale
+Specify frequency scale.
+
+It accepts the following values:
+@table @samp
+@item lin
+linear
+@item log
+logarithmic
+@end table
+
+Default value is @samp{lin}.
+
@item saturation
Set saturation modifier for displayed colors. Negative values provide
alternative color scheme. @code{0} is no saturation at all.
@@ -22316,6 +22747,19 @@ logarithmic
@end table
Default value is @samp{log}.
+@item fscale
+Specify frequency scale.
+
+It accepts the following values:
+@table @samp
+@item lin
+linear
+@item log
+logarithmic
+@end table
+
+Default value is @samp{lin}.
+
@item saturation
Set saturation modifier for displayed colors. Negative values provide
alternative color scheme. @code{0} is no saturation at all.
@@ -22596,6 +23040,20 @@ Cubic root.
@end table
Default is linear.
+
+@item draw
+Set the draw mode.
+
+Available values are:
+@table @samp
+@item scale
+Scale pixel values for each drawn sample.
+
+@item full
+Draw every sample directly.
+@end table
+
+Default value is @code{scale}.
@end table
@subsection Examples
diff --git a/chromium/third_party/ffmpeg/doc/formats.texi b/chromium/third_party/ffmpeg/doc/formats.texi
index a992506ac1d..729c77b01d9 100644
--- a/chromium/third_party/ffmpeg/doc/formats.texi
+++ b/chromium/third_party/ffmpeg/doc/formats.texi
@@ -224,6 +224,28 @@ would require too many resources due to a large number of streams.
@item skip_estimate_duration_from_pts @var{bool} (@emph{input})
Skip estimation of input duration when calculated using PTS.
At present, applicable for MPEG-PS and MPEG-TS.
+
+@item strict, f_strict @var{integer} (@emph{input/output})
+Specify how strictly to follow the standards. @code{f_strict} is deprecated and
+should be used only via the @command{ffmpeg} tool.
+
+Possible values:
+@table @samp
+@item very
+strictly conform to an older more strict version of the spec or reference software
+@item strict
+strictly conform to all the things in the spec no matter what consequences
+@item normal
+
+@item unofficial
+allow unofficial extensions
+@item experimental
+allow non standardized experimental things, experimental
+(unfinished/work in progress/not well tested) decoders and encoders.
+Note: experimental decoders can pose a security risk, do not use this for
+decoding untrusted input.
+@end table
+
@end table
@c man end FORMAT OPTIONS
diff --git a/chromium/third_party/ffmpeg/doc/general.texi b/chromium/third_party/ffmpeg/doc/general.texi
index 109c8c58cc2..3c0c8034490 100644
--- a/chromium/third_party/ffmpeg/doc/general.texi
+++ b/chromium/third_party/ffmpeg/doc/general.texi
@@ -46,22 +46,24 @@ without needing to search for these headers themselves.
For Windows, supported AviSynth variants are
@url{http://avisynth.nl, AviSynth 2.6 RC1 or higher} for 32-bit builds and
-@url{http://avs-plus.net, AviSynth+ r1718 or higher} for 32-bit and 64-bit builds.
+@url{http://avisynth.nl/index.php/AviSynth+, AviSynth+ r1718 or higher} 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
-There is currently a regression in AviSynth+'s @code{capi.h} header as of
-October 2016, which interferes with the ability for builds of FFmpeg to use
-MSVC-built binaries of AviSynth. Until this is resolved, you can make sure
-a known good version is installed by checking out a version from before
-the regression occurred:
-
-@code{git clone -b MT git://github.com/AviSynth/AviSynthPlus.git @*
-cd AviSynthPlus @*
-git checkout -b oldheader b4f292b4dbfad149697fb65c6a037bb3810813f9 @*
-make install PREFIX=/install/prefix}
+In 2016, AviSynth+ added support for building with GCC. However, due to
+the eccentricities of Windows' calling conventions, 32-bit GCC builds
+of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
+
+By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
+AviSynth+ since that is the most widely-used and entrenched build
+configuration. Users can override this and enable support for 32-bit
+GCC builds of AviSynth+ by passing @code{-DAVSC_WIN32_GCC32} to
+@code{--extra-cflags} when configuring FFmpeg.
+
+64-bit builds of FFmpeg are not affected, and can use either MSVC or
+GCC builds of AviSynth+ without any special flags.
@end float
@float NOTE
@@ -95,6 +97,13 @@ Raw codec2 files are also supported.
To make sense of them the mode in use needs to be specified as a format option:
@code{ffmpeg -f codec2raw -mode 1300 -i input.raw output.wav}.
+@section dav1d
+
+FFmpeg can make use of the dav1d library for AV1 video decoding.
+
+Go to @url{https://code.videolan.org/videolan/dav1d} and follow the instructions for
+installing the library. Then pass @code{--enable-libdav1d} to configure to enable it.
+
@section davs2
FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
@@ -459,6 +468,8 @@ library:
@item IEC61937 encapsulation @tab X @tab X
@item IFF @tab @tab X
@tab Interchange File Format
+@item IFV @tab @tab X
+ @tab A format used by some old CCTV DVRs.
@item iLBC @tab X @tab X
@item Interplay MVE @tab @tab X
@tab Format used in various Interplay computer games.
@@ -935,6 +946,8 @@ following image formats are supported:
@tab Video encoding used in NuppelVideo files.
@item On2 VP3 @tab @tab X
@tab still experimental
+@item On2 VP4 @tab @tab X
+ @tab fourcc: VP40
@item On2 VP5 @tab @tab X
@tab fourcc: VP50
@item On2 VP6 @tab @tab X
diff --git a/chromium/third_party/ffmpeg/doc/indevs.texi b/chromium/third_party/ffmpeg/doc/indevs.texi
index 1d5ed657735..14595774f37 100644
--- a/chromium/third_party/ffmpeg/doc/indevs.texi
+++ b/chromium/third_party/ffmpeg/doc/indevs.texi
@@ -178,6 +178,9 @@ Capture the mouse pointer. Default is 0.
@item -capture_mouse_clicks
Capture the screen mouse clicks. Default is 0.
+@item -capture_raw_data
+Capture the raw device data. Default is 0.
+Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched.
@end table
@subsection Examples
@@ -208,6 +211,13 @@ Record video from the system default video device using the pixel format bgr0 an
$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
@end example
+@item
+Record raw DV data from a suitable input device and write the output into out.dv:
+@example
+$ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
+@end example
+
+
@end itemize
@section bktr
@@ -910,6 +920,14 @@ Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and e
ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
@end example
+@item
+To capture only part of a plane the output can be cropped - this can be used to capture
+a single window, as long as it has a known absolute position and size. For example, to
+capture and encode the middle quarter of a 1920x1080 plane:
+@example
+ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
+@end example
+
@end itemize
@section lavfi
diff --git a/chromium/third_party/ffmpeg/doc/muxers.texi b/chromium/third_party/ffmpeg/doc/muxers.texi
index 83ae017d6c2..b109297963d 100644
--- a/chromium/third_party/ffmpeg/doc/muxers.texi
+++ b/chromium/third_party/ffmpeg/doc/muxers.texi
@@ -220,64 +220,64 @@ In addition to the standard identifiers, an ffmpeg-specific "$ext$" identifier i
When specified ffmpeg will replace $ext$ in the file name with muxing format's extensions such as mp4, webm etc.,
@example
-ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264
--b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline
--profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0
--b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1
--window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a"
+ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
+-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
+-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
+-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
+-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
-f dash /path/to/out.mpd
@end example
@table @option
-@item -min_seg_duration @var{microseconds}
+@item min_seg_duration @var{microseconds}
This is a deprecated option to set the segment length in microseconds, use @var{seg_duration} instead.
-@item -seg_duration @var{duration}
+@item seg_duration @var{duration}
Set the segment length in seconds (fractional value can be set). The value is
treated as average segment duration when @var{use_template} is enabled and
@var{use_timeline} is disabled and as minimum segment duration for all the other
use cases.
-@item -window_size @var{size}
+@item window_size @var{size}
Set the maximum number of segments kept in the manifest.
-@item -extra_window_size @var{size}
+@item extra_window_size @var{size}
Set the maximum number of segments kept outside of the manifest before removing from disk.
-@item -remove_at_exit @var{remove}
+@item remove_at_exit @var{remove}
Enable (1) or disable (0) removal of all segments when finished.
-@item -use_template @var{template}
+@item use_template @var{template}
Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
-@item -use_timeline @var{timeline}
+@item use_timeline @var{timeline}
Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
-@item -single_file @var{single_file}
+@item single_file @var{single_file}
Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
-@item -single_file_name @var{file_name}
+@item single_file_name @var{file_name}
DASH-templated name to be used for baseURL. Implies @var{single_file} set to "1". In the template, "$ext$" is replaced with the file name extension specific for the segment format.
-@item -init_seg_name @var{init_name}
+@item init_seg_name @var{init_name}
DASH-templated name to used for the initialization segment. Default is "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format.
-@item -media_seg_name @var{segment_name}
+@item media_seg_name @var{segment_name}
DASH-templated name to used for the media segments. Default is "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format.
-@item -utc_timing_url @var{utc_url}
+@item utc_timing_url @var{utc_url}
URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso"
@item method @var{method}
Use the given HTTP method to create output files. Generally set to PUT or POST.
-@item -http_user_agent @var{user_agent}
+@item http_user_agent @var{user_agent}
Override User-Agent field in HTTP header. Applicable only for HTTP output.
-@item -http_persistent @var{http_persistent}
+@item http_persistent @var{http_persistent}
Use persistent HTTP connections. Applicable only for HTTP output.
-@item -hls_playlist @var{hls_playlist}
+@item hls_playlist @var{hls_playlist}
Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8.
One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
-@item -streaming @var{streaming}
+@item streaming @var{streaming}
Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
mode, each frame will be a moof fragment which forms a chunk.
-@item -adaptation_sets @var{adaptation_sets}
+@item adaptation_sets @var{adaptation_sets}
Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c id=y,streams=d,e" with x and y being the IDs
of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs.
When no assignment is defined, this defaults to an AdaptationSet for each stream.
-@item -timeout @var{timeout}
+@item timeout @var{timeout}
Set timeout for socket I/O operations. Applicable only for HTTP output.
-@item -index_correction @var{index_correction}
+@item index_correction @var{index_correction}
Enable (1) or Disable (0) segment index correction logic. Applicable only when
@var{use_template} is enabled and @var{use_timeline} is disabled.
@@ -288,16 +288,17 @@ corrects that index value.
Typically this logic is needed in live streaming use cases. The network bandwidth
fluctuations are common during long run streaming. Each fluctuation can cause
the segment indexes fall behind the expected real time position.
-@item -format_options @var{options_list}
+@item format_options @var{options_list}
Set container format (mp4/webm) options using a @code{:} separated list of
key=value parameters. Values containing @code{:} special characters must be
escaped.
-@item -global_sidx @var{global_sidx}
+@item global_sidx @var{global_sidx}
Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
-@item -dash_segment_type @var{dash_segment_type}
+@item dash_segment_type @var{dash_segment_type}
Possible values:
+@table @option
@item auto
If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.
@@ -306,11 +307,12 @@ If this flag is set, the dash segment files will be in in ISOBMFF format.
@item webm
If this flag is set, the dash segment files will be in in WebM format.
+@end table
-@item -ignore_io_errors @var{ignore_io_errors}
+@item ignore_io_errors @var{ignore_io_errors}
Ignore IO errors during open and write. Useful for long-duration runs with network output.
-@item -lhls @var{lhls}
+@item lhls @var{lhls}
Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment's URI.
Apple doesn't have an official spec for LHLS. Meanwhile hls.js player folks are
trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
@@ -318,7 +320,7 @@ This option will also try to comply with the above open spec, till Apple's spec
Applicable only when @var{streaming} and @var{hls_playlist} options are enabled.
This is an experimental feature.
-@item -master_m3u8_publish_rate @var{master_m3u8_publish_rate}
+@item master_m3u8_publish_rate @var{master_m3u8_publish_rate}
Publish master playlist repeatedly every after specified number of segment intervals.
@end table
@@ -656,7 +658,8 @@ This example will produce the playlists segment file sets:
@file{file_1_000.ts}, @file{file_1_001.ts}, @file{file_1_002.ts}, etc.
The string "%v" may be present in the filename or in the last directory name
-containing the file. If the string is present in the directory name, then
+containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
+sub-directory or filename.) If the string %v is present in the directory name, then
sub-directories are created after expanding the directory name pattern. This
enables creation of segments corresponding to different variant streams in
subdirectories.
@@ -852,6 +855,10 @@ including the file containing the AES encryption key.
Add the @code{#EXT-X-INDEPENDENT-SEGMENTS} to playlists that has video segments
and when all the segments of that playlist are guaranteed to start with a Key frame.
+@item iframes_only
+Add the @code{#EXT-X-I-FRAMES-ONLY} to playlists that has video segments
+and can play only I-frames in the @code{#EXT-X-BYTERANGE} mode.
+
@item split_by_time
Allow segments to start on frames other than keyframes. This improves
behavior on some players when the time between keyframes is inconsistent,
@@ -888,7 +895,11 @@ This will produce segments like this:
@item temp_file
Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
-before they have been added to the m3u8 playlist.
+before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
+If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
+But playlists with @code{file} protocol and with type (@code{hls_playlist_type}) other than @code{vod}
+are always written into temporary file regardles of this flag. Master playlist files (@code{master_pl_name}), if any, with @code{file} protocol,
+are always written into temporary file regardles of this flag if @code{master_pl_publish_rate} value is other than zero.
@end table
@@ -939,7 +950,21 @@ This example creates two hls variant streams. The first variant stream will
contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
second variant stream will contain video stream of bitrate 256k and audio
stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
-out_1.m3u8 will be created.
+out_1.m3u8 will be created. If you want something meaningful text instead of indexes
+in result names, you may specify names for each or some of the variants
+as in the following example.
+
+
+@example
+ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+ -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \
+ http://example.com/live/out_%v.m3u8
+@end example
+
+This example creates two hls variant streams as in the previous one.
+But here, the two media playlist with file names out_my_hd.m3u8 and
+out_my_sd.m3u8 will be created.
+
@example
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
-map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \
@@ -991,7 +1016,7 @@ By default, a single hls variant containing all the encoded streams is created.
@example
ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
-map 0:a -map 0:a -map 0:v -f hls \
- -var_stream_map "a:0,agroup:aud_low,default:yes,language=ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \
+ -var_stream_map "a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low" \
-master_pl_name master.m3u8 \
http://example.com/live/out_%v.m3u8
@end example
@@ -1070,6 +1095,9 @@ Set timeout for socket I/O operations. Applicable only for HTTP output.
@item -ignore_io_errors
Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
+@item headers
+Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
+
@end table
@anchor{ico}
diff --git a/chromium/third_party/ffmpeg/doc/scaler.texi b/chromium/third_party/ffmpeg/doc/scaler.texi
index f73804adfef..eb045de6b77 100644
--- a/chromium/third_party/ffmpeg/doc/scaler.texi
+++ b/chromium/third_party/ffmpeg/doc/scaler.texi
@@ -5,7 +5,8 @@
The video scaler supports the following named options.
Options may be set by specifying -@var{option} @var{value} in the
-FFmpeg tools. For programmatic use, they can be set explicitly in the
+FFmpeg tools, with a few API-only exceptions noted below.
+For programmatic use, they can be set explicitly in the
@code{SwsContext} options or through the @file{libavutil/opt.h} API.
@table @option
@@ -47,7 +48,8 @@ Select Gaussian rescaling algorithm.
Select sinc rescaling algorithm.
@item lanczos
-Select Lanczos rescaling algorithm.
+Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
+changed by setting @code{param0}.
@item spline
Select natural bicubic spline rescaling algorithm.
@@ -68,29 +70,31 @@ Select full chroma input.
Enable bitexact output.
@end table
-@item srcw
+@item srcw @var{(API only)}
Set source width.
-@item srch
+@item srch @var{(API only)}
Set source height.
-@item dstw
+@item dstw @var{(API only)}
Set destination width.
-@item dsth
+@item dsth @var{(API only)}
Set destination height.
-@item src_format
+@item src_format @var{(API only)}
Set source pixel format (must be expressed as an integer).
-@item dst_format
+@item dst_format @var{(API only)}
Set destination pixel format (must be expressed as an integer).
-@item src_range
-Select source range.
+@item src_range @var{(boolean)}
+If value is set to @code{1}, indicates source is full range. Default value is
+@code{0}, which indicates source is limited range.
-@item dst_range
-Select destination range.
+@item dst_range @var{(boolean)}
+If value is set to @code{1}, enable full range for destination. Default value
+is @code{0}, which enables limited range.
@anchor{sws_params}
@item param0, param1
diff --git a/chromium/third_party/ffmpeg/doc/writing_filters.txt b/chromium/third_party/ffmpeg/doc/writing_filters.txt
index 98b9c6f3d29..2e25cbed71b 100644
--- a/chromium/third_party/ffmpeg/doc/writing_filters.txt
+++ b/chromium/third_party/ffmpeg/doc/writing_filters.txt
@@ -389,7 +389,7 @@ distributor with something like this:
td.in = in;
td.out = out;
- ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
+ ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
// ...
diff --git a/chromium/third_party/ffmpeg/ffmpeg_generated.gni b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
index 3d53c729c37..5d89a723f54 100644
--- a/chromium/third_party/ffmpeg/ffmpeg_generated.gni
+++ b/chromium/third_party/ffmpeg/ffmpeg_generated.gni
@@ -185,6 +185,7 @@ if ((is_android && current_cpu == "arm" && arm_use_neon) || (is_android && curre
"libavutil/time.c",
"libavutil/timecode.c",
"libavutil/twofish.c",
+ "libavutil/tx.c",
"libavutil/utils.c",
]
}
diff --git a/chromium/third_party/ffmpeg/fftools/ffmpeg.h b/chromium/third_party/ffmpeg/fftools/ffmpeg.h
index eb1eaf63633..7b6f802082a 100644
--- a/chromium/third_party/ffmpeg/fftools/ffmpeg.h
+++ b/chromium/third_party/ffmpeg/fftools/ffmpeg.h
@@ -72,7 +72,7 @@ typedef struct HWAccel {
} HWAccel;
typedef struct HWDevice {
- char *name;
+ const char *name;
enum AVHWDeviceType type;
AVBufferRef *device_ref;
} HWDevice;
diff --git a/chromium/third_party/ffmpeg/fftools/ffmpeg_hw.c b/chromium/third_party/ffmpeg/fftools/ffmpeg_hw.c
index 2ec18138543..962d8f7d5a4 100644
--- a/chromium/third_party/ffmpeg/fftools/ffmpeg_hw.c
+++ b/chromium/third_party/ffmpeg/fftools/ffmpeg_hw.c
@@ -99,7 +99,7 @@ int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
// -> av_hwdevice_ctx_create_derived()
AVDictionary *options = NULL;
- char *type_name = NULL, *name = NULL, *device = NULL;
+ const char *type_name = NULL, *name = NULL, *device = NULL;
enum AVHWDeviceType type;
HWDevice *dev, *src;
AVBufferRef *device_ref = NULL;
@@ -155,10 +155,12 @@ int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
++p;
q = strchr(p, ',');
if (q) {
- device = av_strndup(p, q - p);
- if (!device) {
- err = AVERROR(ENOMEM);
- goto fail;
+ if (q - p > 0) {
+ device = av_strndup(p, q - p);
+ if (!device) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
}
err = av_dict_parse_string(&options, q + 1, "=", ",", 0);
if (err < 0) {
@@ -168,7 +170,8 @@ int hw_device_init_from_string(const char *arg, HWDevice **dev_out)
}
err = av_hwdevice_ctx_create(&device_ref, type,
- device ? device : p, options, 0);
+ q ? device : p[0] ? p : NULL,
+ options, 0);
if (err < 0)
goto fail;
diff --git a/chromium/third_party/ffmpeg/fftools/ffmpeg_opt.c b/chromium/third_party/ffmpeg/fftools/ffmpeg_opt.c
index 53d688b7649..f5ca18aa644 100644
--- a/chromium/third_party/ffmpeg/fftools/ffmpeg_opt.c
+++ b/chromium/third_party/ffmpeg/fftools/ffmpeg_opt.c
@@ -2198,7 +2198,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
for (i = 0; i < nb_input_streams; i++) {
int new_area;
ist = input_streams[i];
- new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames;
+ new_area = ist->st->codecpar->width * ist->st->codecpar->height + 100000000*!!ist->st->codec_info_nb_frames
+ + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
if (ist->user_set_discard == AVDISCARD_ALL)
continue;
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
@@ -2221,7 +2222,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
for (i = 0; i < nb_input_streams; i++) {
int score;
ist = input_streams[i];
- score = ist->st->codecpar->channels + 100000000*!!ist->st->codec_info_nb_frames;
+ score = ist->st->codecpar->channels + 100000000*!!ist->st->codec_info_nb_frames
+ + 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
if (ist->user_set_discard == AVDISCARD_ALL)
continue;
if (ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
diff --git a/chromium/third_party/ffmpeg/fftools/ffplay.c b/chromium/third_party/ffmpeg/fftools/ffplay.c
index 8f050e16e64..8fb8faeb060 100644
--- a/chromium/third_party/ffmpeg/fftools/ffplay.c
+++ b/chromium/third_party/ffmpeg/fftools/ffplay.c
@@ -324,6 +324,7 @@ static int seek_by_bytes = -1;
static float seek_interval = 10;
static int display_disable;
static int borderless;
+static int alwaysontop;
static int startup_volume = 100;
static int show_status = 1;
static int av_sync_type = AV_SYNC_AUDIO_MASTER;
@@ -3581,6 +3582,7 @@ static const OptionDef options[] = {
{ "seek_interval", OPT_FLOAT | HAS_ARG, { &seek_interval }, "set seek interval for left/right keys, in seconds", "seconds" },
{ "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" },
{ "noborder", OPT_BOOL, { &borderless }, "borderless window" },
+ { "alwaysontop", OPT_BOOL, { &alwaysontop }, "window always on top" },
{ "volume", OPT_INT | HAS_ARG, { &startup_volume}, "set startup volume 0=min 100=max", "volume" },
{ "f", HAS_ARG, { .func_arg = opt_format }, "force format", "fmt" },
{ "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" },
@@ -3722,6 +3724,12 @@ int main(int argc, char **argv)
if (!display_disable) {
int flags = SDL_WINDOW_HIDDEN;
+ if (alwaysontop)
+#if SDL_VERSION_ATLEAST(2,0,5)
+ flags |= SDL_WINDOW_ALWAYS_ON_TOP;
+#else
+ av_log(NULL, AV_LOG_WARNING, "Your SDL version doesn't support SDL_WINDOW_ALWAYS_ON_TOP. Feature will be inactive.\n");
+#endif
if (borderless)
flags |= SDL_WINDOW_BORDERLESS;
else
diff --git a/chromium/third_party/ffmpeg/fftools/ffprobe.c b/chromium/third_party/ffmpeg/fftools/ffprobe.c
index dea489d02eb..5aaddb03089 100644
--- a/chromium/third_party/ffmpeg/fftools/ffprobe.c
+++ b/chromium/third_party/ffmpeg/fftools/ffprobe.c
@@ -165,6 +165,8 @@ typedef enum {
SECTION_ID_FRAME_TAGS,
SECTION_ID_FRAME_SIDE_DATA_LIST,
SECTION_ID_FRAME_SIDE_DATA,
+ SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST,
+ SECTION_ID_FRAME_SIDE_DATA_TIMECODE,
SECTION_ID_FRAME_LOG,
SECTION_ID_FRAME_LOGS,
SECTION_ID_LIBRARY_VERSION,
@@ -209,7 +211,9 @@ static struct section sections[] = {
[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDE_DATA_LIST, SECTION_ID_FRAME_LOGS, -1 } },
[SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" },
[SECTION_ID_FRAME_SIDE_DATA_LIST] ={ SECTION_ID_FRAME_SIDE_DATA_LIST, "side_data_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA, -1 }, .element_name = "side_data", .unique_name = "frame_side_data_list" },
- [SECTION_ID_FRAME_SIDE_DATA] = { SECTION_ID_FRAME_SIDE_DATA, "side_data", 0, { -1 } },
+ [SECTION_ID_FRAME_SIDE_DATA] = { SECTION_ID_FRAME_SIDE_DATA, "side_data", 0, { SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST, -1 } },
+ [SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST, "timecodes", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, -1 } },
+ [SECTION_ID_FRAME_SIDE_DATA_TIMECODE] = { SECTION_ID_FRAME_SIDE_DATA_TIMECODE, "timecode", 0, { -1 } },
[SECTION_ID_FRAME_LOGS] = { SECTION_ID_FRAME_LOGS, "logs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_LOG, -1 } },
[SECTION_ID_FRAME_LOG] = { SECTION_ID_FRAME_LOG, "log", 0, { -1 }, },
[SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
@@ -2199,6 +2203,18 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
char tcbuf[AV_TIMECODE_STR_SIZE];
av_timecode_make_mpeg_tc_string(tcbuf, *(int64_t *)(sd->data));
print_str("timecode", tcbuf);
+ } else if (sd->type == AV_FRAME_DATA_S12M_TIMECODE && sd->size == 16) {
+ uint32_t *tc = (uint32_t*)sd->data;
+ int m = FFMIN(tc[0],3);
+ writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE_LIST);
+ for (int j = 1; j <= m ; j++) {
+ char tcbuf[AV_TIMECODE_STR_SIZE];
+ av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
+ writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_TIMECODE);
+ print_str("value", tcbuf);
+ writer_print_section_footer(w);
+ }
+ writer_print_section_footer(w);
} else if (sd->type == AV_FRAME_DATA_MASTERING_DISPLAY_METADATA) {
AVMasteringDisplayMetadata *metadata = (AVMasteringDisplayMetadata *)sd->data;
@@ -2413,9 +2429,7 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile,
}
av_packet_unref(&pkt);
}
- av_init_packet(&pkt);
- pkt.data = NULL;
- pkt.size = 0;
+ av_packet_unref(&pkt);
//Flush remaining frames that are cached in the decoder
for (i = 0; i < fmt_ctx->nb_streams; i++) {
pkt.stream_index = i;
diff --git a/chromium/third_party/ffmpeg/libavcodec/4xm.c b/chromium/third_party/ffmpeg/libavcodec/4xm.c
index 2b88c899d0a..8382159bdec 100644
--- a/chromium/third_party/ffmpeg/libavcodec/4xm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/4xm.c
@@ -158,7 +158,7 @@ typedef struct FourXContext {
#define FIX_1_847759065 121095
#define FIX_2_613125930 171254
-#define MULTIPLY(var, const) (((var) * (const)) >> 16)
+#define MULTIPLY(var, const) ((int)((var) * (unsigned)(const)) >> 16)
static void idct(int16_t block[64])
{
@@ -697,6 +697,7 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
len_tab[j] = len;
}
+ ff_free_vlc(&f->pre_vlc);
if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257, len_tab, 1, 1,
bits_tab, 4, 4, 0))
return NULL;
diff --git a/chromium/third_party/ffmpeg/libavcodec/Makefile b/chromium/third_party/ffmpeg/libavcodec/Makefile
index f37135fc07b..3cd73fbcc60 100644
--- a/chromium/third_party/ffmpeg/libavcodec/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/Makefile
@@ -1042,7 +1042,7 @@ OBJS-$(CONFIG_H263_PARSER) += h263_parser.o
OBJS-$(CONFIG_H264_PARSER) += h264_parser.o h264_sei.o h264data.o
OBJS-$(CONFIG_HEVC_PARSER) += hevc_parser.o hevc_data.o
OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
-OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
+OBJS-$(CONFIG_MLP_PARSER) += mlp_parse.o mlp_parser.o mlp.o
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
mpeg4videodec.o mpeg4video.o \
ituh263dec.o h263dec.o h263data.o
@@ -1081,7 +1081,7 @@ OBJS-$(CONFIG_H264_METADATA_BSF) += h264_metadata_bsf.o h264_levels.o
OBJS-$(CONFIG_H264_MP4TOANNEXB_BSF) += h264_mp4toannexb_bsf.o
OBJS-$(CONFIG_H264_REDUNDANT_PPS_BSF) += h264_redundant_pps_bsf.o
OBJS-$(CONFIG_HAPQA_EXTRACT_BSF) += hapqa_extract_bsf.o hap.o
-OBJS-$(CONFIG_HEVC_METADATA_BSF) += h265_metadata_bsf.o
+OBJS-$(CONFIG_HEVC_METADATA_BSF) += h265_metadata_bsf.o h265_profile_level.o
OBJS-$(CONFIG_HEVC_MP4TOANNEXB_BSF) += hevc_mp4toannexb_bsf.o
OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += imx_dump_header_bsf.o
OBJS-$(CONFIG_MJPEG2JPEG_BSF) += mjpeg2jpeg_bsf.o
@@ -1097,7 +1097,7 @@ OBJS-$(CONFIG_PRORES_METADATA_BSF) += prores_metadata_bsf.o
OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
OBJS-$(CONFIG_TRACE_HEADERS_BSF) += trace_headers_bsf.o
-OBJS-$(CONFIG_TRUEHD_CORE_BSF) += truehd_core_bsf.o mlp_parser.o mlp.o
+OBJS-$(CONFIG_TRUEHD_CORE_BSF) += truehd_core_bsf.o mlp_parse.o mlp.o
OBJS-$(CONFIG_VP9_METADATA_BSF) += vp9_metadata_bsf.o
OBJS-$(CONFIG_VP9_RAW_REORDER_BSF) += vp9_raw_reorder_bsf.o
OBJS-$(CONFIG_VP9_SUPERFRAME_BSF) += vp9_superframe_bsf.o
@@ -1161,6 +1161,7 @@ TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter
TESTPROGS-$(HAVE_MMX) += motion
TESTPROGS-$(CONFIG_MPEGVIDEO) += mpeg12framerate
TESTPROGS-$(CONFIG_H264_METADATA_BSF) += h264_levels
+TESTPROGS-$(CONFIG_HEVC_METADATA_BSF) += h265_levels
TESTPROGS-$(CONFIG_RANGECODER) += rangecoder
TESTPROGS-$(CONFIG_SNOW_ENCODER) += snowenc
diff --git a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
index 91aac0933f1..38f25020f5e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/a64multienc.c
@@ -60,11 +60,11 @@ typedef struct A64Context {
} A64Context;
/* gray gradient */
-static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
+static const uint8_t mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
/* other possible gradients - to be tested */
-//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
-//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
+//static const uint8_t mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
+//static const uint8_t mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
static void to_meta_with_crop(AVCodecContext *avctx,
const AVFrame *p, int *dest)
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec.c b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
index d394700cdc8..c606ad40a9a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec.c
@@ -247,14 +247,12 @@ static void apply_independent_coupling(AACContext *ac,
SingleChannelElement *target,
ChannelElement *cce, int index)
{
- int i;
const float gain = cce->coup.gain[index][0];
const float *src = cce->ch[0].ret;
float *dest = target->ret;
const int len = 1024 << (ac->oc[1].m4ac.sbr == 1);
- for (i = 0; i < len; i++)
- dest[i] += gain * src[i];
+ ac->fdsp->vector_fmac_scalar(dest, src, gain, len);
}
#include "aacdec_template.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c b/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c
index 2c594c67922..1d0142fdb02 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec_fixed.c
@@ -195,12 +195,12 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len, vo
static void noise_scale(int *coefs, int scale, int band_energy, int len)
{
- int ssign = scale < 0 ? -1 : 1;
- int s = FFABS(scale);
+ int s = -scale;
unsigned int round;
int i, out, c = exp2tab[s & 3];
int nlz = 0;
+ av_assert0(s >= 0);
while (band_energy > 0x7fff) {
band_energy >>= 1;
nlz++;
@@ -216,15 +216,20 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
round = s ? 1 << (s-1) : 0;
for (i=0; i<len; i++) {
out = (int)(((int64_t)coefs[i] * c) >> 32);
- coefs[i] = ((int)(out+round) >> s) * ssign;
+ coefs[i] = -((int)(out+round) >> s);
}
}
else {
s = s + 32;
- round = 1 << (s-1);
- for (i=0; i<len; i++) {
- out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
- coefs[i] = out * ssign;
+ if (s > 0) {
+ round = 1 << (s-1);
+ for (i=0; i<len; i++) {
+ out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
+ coefs[i] = -out;
+ }
+ } else {
+ for (i=0; i<len; i++)
+ coefs[i] = -(int64_t)coefs[i] * c * (1 << -s);
}
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c b/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c
index 721511c5e95..28765c768d0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacdec_template.c
@@ -1673,25 +1673,24 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024],
}
} else if (cbt_m1 == NOISE_BT - 1) {
for (group = 0; group < (AAC_SIGNE)g_len; group++, cfo+=128) {
-#if !USE_FIXED
- float scale;
-#endif /* !USE_FIXED */
INTFLOAT band_energy;
-
+#if USE_FIXED
for (k = 0; k < off_len; k++) {
ac->random_state = lcg_random(ac->random_state);
-#if USE_FIXED
cfo[k] = ac->random_state >> 3;
-#else
- cfo[k] = ac->random_state;
-#endif /* USE_FIXED */
}
-#if USE_FIXED
band_energy = ac->fdsp->scalarproduct_fixed(cfo, cfo, off_len);
band_energy = fixed_sqrt(band_energy, 31);
noise_scale(cfo, sf[idx], band_energy, off_len);
#else
+ float scale;
+
+ for (k = 0; k < off_len; k++) {
+ ac->random_state = lcg_random(ac->random_state);
+ cfo[k] = ac->random_state;
+ }
+
band_energy = ac->fdsp->scalarproduct_float(cfo, cfo, off_len);
scale = sf[idx] / sqrtf(band_energy);
ac->fdsp->vector_fmul_scalar(cfo, cfo, scale, off_len);
@@ -2493,6 +2492,9 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns,
INTFLOAT tmp[TNS_MAX_ORDER+1];
UINTFLOAT *coef = coef_param;
+ if(!mmm)
+ return;
+
for (w = 0; w < ics->num_windows; w++) {
bottom = ics->num_swb;
for (filt = 0; filt < tns->n_filt[w]; filt++) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacenc_ltp.c b/chromium/third_party/ffmpeg/libavcodec/aacenc_ltp.c
index 674a2a06807..f77f0b6a729 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacenc_ltp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacenc_ltp.c
@@ -144,7 +144,7 @@ void ff_aac_adjust_common_ltp(AACEncContext *s, ChannelElement *cpe)
int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb];
if (sum != 2) {
sce0->ics.ltp.used[sfb] = 0;
- } else if (sum == 2) {
+ } else {
count++;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c
index 5f4be017d57..eef8adc7e26 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aacpsdsp_template.c
@@ -54,10 +54,10 @@ static void ps_hybrid_analysis_c(INTFLOAT (*out)[2], INTFLOAT (*in)[2],
INT64FLOAT sum_im = (INT64FLOAT)filter[i][6][0] * in[6][1];
for (j = 0; j < 6; j++) {
- INTFLOAT in0_re = in[j][0];
- INTFLOAT in0_im = in[j][1];
- INTFLOAT in1_re = in[12-j][0];
- INTFLOAT in1_im = in[12-j][1];
+ INT64FLOAT in0_re = in[j][0];
+ INT64FLOAT in0_im = in[j][1];
+ INT64FLOAT in1_re = in[12-j][0];
+ INT64FLOAT in1_im = in[12-j][1];
sum_re += (INT64FLOAT)filter[i][j][0] * (in0_re + in1_re) -
(INT64FLOAT)filter[i][j][1] * (in0_im - in1_im);
sum_im += (INT64FLOAT)filter[i][j][0] * (in0_im + in1_im) +
diff --git a/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h b/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h
index e05c5ad2e4c..fc38eed2985 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h
+++ b/chromium/third_party/ffmpeg/libavcodec/aarch64/asm-offsets.h
@@ -19,14 +19,6 @@
#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
-
/* FFTContext */
#define IMDCT_HALF 0x48
diff --git a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
index e7e18af92d5..f1c95ce8773 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ac3enc.c
@@ -652,7 +652,7 @@ void ff_ac3_process_exponents(AC3EncodeContext *s)
*/
static void count_frame_bits_fixed(AC3EncodeContext *s)
{
- static const int frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
+ static const uint8_t frame_bits_inc[8] = { 0, 0, 2, 2, 2, 4, 2, 4 };
int blk;
int frame_bits;
diff --git a/chromium/third_party/ffmpeg/libavcodec/adpcm.c b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
index ede0130bf1a..e194764374c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/adpcm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/adpcm.c
@@ -57,7 +57,7 @@
*/
/* These are for CD-ROM XA ADPCM */
-static const int xa_adpcm_table[5][2] = {
+static const int8_t xa_adpcm_table[5][2] = {
{ 0, 0 },
{ 60, 0 },
{ 115, -52 },
@@ -65,7 +65,7 @@ static const int xa_adpcm_table[5][2] = {
{ 122, -60 }
};
-static const int ea_adpcm_table[] = {
+static const int16_t ea_adpcm_table[] = {
0, 240, 460, 392,
0, 0, -208, -220,
0, 1, 3, 4,
@@ -74,7 +74,7 @@ static const int ea_adpcm_table[] = {
};
// padded to zero where table size is less then 16
-static const int swf_index_tables[4][16] = {
+static const int8_t swf_index_tables[4][16] = {
/*2*/ { -1, 2 },
/*3*/ { -1, -1, 2, 4 },
/*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 },
@@ -484,7 +484,7 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
{
ADPCMDecodeContext *c = avctx->priv_data;
GetBitContext gb;
- const int *table;
+ const int8_t *table;
int k0, signmask, nb_bits, count;
int size = buf_size*8;
int i;
diff --git a/chromium/third_party/ffmpeg/libavcodec/agm.c b/chromium/third_party/ffmpeg/libavcodec/agm.c
index 7dcfaff4adc..a499c090822 100644
--- a/chromium/third_party/ffmpeg/libavcodec/agm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/agm.c
@@ -103,6 +103,9 @@ static int read_code(GetBitContext *gb, int *oskip, int *level, int *map, int mo
{
int len = 0, skip = 0, max;
+ if (get_bits_left(gb) < 2)
+ return AVERROR_INVALIDDATA;
+
if (show_bits(gb, 2)) {
switch (show_bits(gb, 4)) {
case 1:
@@ -1046,6 +1049,9 @@ static int decode_huffman2(AVCodecContext *avctx, int header, int size)
s->output_size = get_bits_long(gb, 32);
+ if (s->output_size > avctx->width * avctx->height * 9LL + 10000)
+ return AVERROR_INVALIDDATA;
+
av_fast_padded_malloc(&s->output, &s->padded_output_size, s->output_size);
if (!s->output)
return AVERROR(ENOMEM);
diff --git a/chromium/third_party/ffmpeg/libavcodec/aic.c b/chromium/third_party/ffmpeg/libavcodec/aic.c
index dc28c83661e..956d71fcff9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/aic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/aic.c
@@ -42,9 +42,9 @@ enum AICBands {
NUM_BANDS
};
-static const int aic_num_band_coeffs[NUM_BANDS] = { 64, 32, 192, 96 };
+static const uint8_t aic_num_band_coeffs[NUM_BANDS] = { 64, 32, 192, 96 };
-static const int aic_band_off[NUM_BANDS] = { 0, 64, 96, 288 };
+static const uint16_t aic_band_off[NUM_BANDS] = { 0, 64, 96, 288 };
static const uint8_t aic_quant_matrix[64] = {
8, 16, 19, 22, 22, 26, 26, 27,
diff --git a/chromium/third_party/ffmpeg/libavcodec/alac.c b/chromium/third_party/ffmpeg/libavcodec/alac.c
index 2f443406615..c234d7153b9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alac.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alac.c
@@ -306,7 +306,7 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
rice_history_mult[ch] = get_bits(&alac->gb, 3);
lpc_order[ch] = get_bits(&alac->gb, 5);
- if (lpc_order[ch] >= alac->max_samples_per_frame)
+ if (lpc_order[ch] >= alac->max_samples_per_frame || !lpc_quant[ch])
return AVERROR_INVALIDDATA;
/* read the predictor table */
diff --git a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
index 6178d31b5c0..d2f9a39ce57 100644
--- a/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/allcodecs.c
@@ -330,6 +330,7 @@ extern AVCodec ff_vcr1_decoder;
extern AVCodec ff_vmdvideo_decoder;
extern AVCodec ff_vmnc_decoder;
extern AVCodec ff_vp3_decoder;
+extern AVCodec ff_vp4_decoder;
extern AVCodec ff_vp5_decoder;
extern AVCodec ff_vp6_decoder;
extern AVCodec ff_vp6a_decoder;
diff --git a/chromium/third_party/ffmpeg/libavcodec/alsdec.c b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
index ca8701e6d0d..5eb2a58aaf0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/alsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/alsdec.c
@@ -487,7 +487,7 @@ static void parse_bs_info(const uint32_t bs_info, unsigned int n,
static int32_t decode_rice(GetBitContext *gb, unsigned int k)
{
int max = get_bits_left(gb) - k;
- int q = get_unary(gb, 0, max);
+ unsigned q = get_unary(gb, 0, max);
int r = k ? get_bits1(gb) : !(q & 1);
if (k > 1) {
@@ -767,8 +767,8 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
if (*bd->use_ltp) {
int r, c;
- bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
- bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
+ bd->ltp_gain[0] = decode_rice(gb, 1) * 8;
+ bd->ltp_gain[1] = decode_rice(gb, 2) * 8;
r = get_unary(gb, 0, 4);
c = get_bits(gb, 2);
@@ -779,8 +779,8 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
bd->ltp_gain[2] = ltp_gain_values[r][c];
- bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
- bd->ltp_gain[4] = decode_rice(gb, 1) << 3;
+ bd->ltp_gain[3] = decode_rice(gb, 2) * 8;
+ bd->ltp_gain[4] = decode_rice(gb, 1) * 8;
*bd->ltp_lag = get_bits(gb, ctx->ltp_lag_length);
*bd->ltp_lag += FFMAX(4, opt_order + 1);
@@ -789,14 +789,20 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
// read first value and residuals in case of a random access block
if (bd->ra_block) {
+ start = FFMIN(opt_order, 3);
+ av_assert0(sb_length <= sconf->frame_length);
+ if (sb_length <= start) {
+ // opt_order or sb_length may be corrupted, either way this is unsupported and not well defined in the specification
+ av_log(avctx, AV_LOG_ERROR, "Sub block length smaller or equal start\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
if (opt_order)
bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4);
if (opt_order > 1)
bd->raw_samples[1] = decode_rice(gb, FFMIN(s[0] + 3, ctx->s_max));
if (opt_order > 2)
bd->raw_samples[2] = decode_rice(gb, FFMIN(s[0] + 1, ctx->s_max));
-
- start = FFMIN(opt_order, 3);
}
// read all residuals
@@ -861,7 +867,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
res >>= 1;
if (cur_k) {
- res *= 1 << cur_k;
+ res *= 1U << cur_k;
res |= get_bits_long(gb, cur_k);
}
}
@@ -1033,7 +1039,7 @@ static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
if (*bd->shift_lsbs)
for (smp = 0; smp < bd->block_length; smp++)
- bd->raw_samples[smp] <<= *bd->shift_lsbs;
+ bd->raw_samples[smp] = (unsigned)bd->raw_samples[smp] << *bd->shift_lsbs;
return 0;
}
@@ -1379,6 +1385,9 @@ static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) {
mantissa_temp = (uint64_t)a.mant * (uint64_t)b.mant;
mask_64 = (uint64_t)0x1 << 47;
+ if (!mantissa_temp)
+ return FLOAT_0;
+
// Count the valid bit count
while (!(mantissa_temp & mask_64) && mask_64) {
bit_count--;
@@ -1796,11 +1805,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
if (!ctx->cs_switch) { \
for (sample = 0; sample < ctx->cur_frame_length; sample++) \
for (c = 0; c < avctx->channels; c++) \
- *dest++ = ctx->raw_samples[c][sample] << shift; \
+ *dest++ = ctx->raw_samples[c][sample] * (1U << shift); \
} else { \
for (sample = 0; sample < ctx->cur_frame_length; sample++) \
for (c = 0; c < avctx->channels; c++) \
- *dest++ = ctx->raw_samples[sconf->chan_pos[c]][sample] << shift; \
+ *dest++ = ctx->raw_samples[sconf->chan_pos[c]][sample] * (1U << shift); \
} \
}
@@ -1984,6 +1993,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
// allocate quantized parcor coefficient buffer
num_buffers = sconf->mc_coding ? avctx->channels : 1;
+ if (num_buffers * (uint64_t)num_buffers > INT_MAX) // protect chan_data_buffer allocation
+ return AVERROR_INVALIDDATA;
ctx->quant_cof = av_malloc_array(num_buffers, sizeof(*ctx->quant_cof));
ctx->lpc_cof = av_malloc_array(num_buffers, sizeof(*ctx->lpc_cof));
@@ -2116,7 +2127,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
fail:
- decode_end(avctx);
return ret;
}
@@ -2142,4 +2152,5 @@ AVCodec ff_als_decoder = {
.decode = decode_frame,
.flush = flush,
.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/apedec.c b/chromium/third_party/ffmpeg/libavcodec/apedec.c
index 15eb416ba4e..eb31fd70c16 100644
--- a/chromium/third_party/ffmpeg/libavcodec/apedec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/apedec.c
@@ -460,7 +460,7 @@ static inline void update_rice(APERice *rice, unsigned int x)
if (rice->ksum < lim)
rice->k--;
- else if (rice->ksum >= (1 << (rice->k + 5)))
+ else if (rice->ksum >= (1 << (rice->k + 5)) && rice->k < 24)
rice->k++;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/arbc.c b/chromium/third_party/ffmpeg/libavcodec/arbc.c
index a8b0bb0d8bc..06970f140b0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/arbc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/arbc.c
@@ -38,15 +38,16 @@ typedef struct ARBCContext {
AVFrame *prev_frame;
} ARBCContext;
-static void fill_tile4(AVCodecContext *avctx, int color, AVFrame *frame)
+static int fill_tile4(AVCodecContext *avctx, int color, AVFrame *frame)
{
ARBCContext *s = avctx->priv_data;
GetByteContext *gb = &s->gb;
int nb_tiles = bytestream2_get_le16(gb);
int h = avctx->height - 1;
+ int pixels_overwritten = 0;
if ((avctx->width / 4 + 1) * (avctx->height / 4 + 1) < nb_tiles)
- return;
+ return 0;
for (int i = 0; i < nb_tiles; i++) {
int y = bytestream2_get_byte(gb);
@@ -63,14 +64,16 @@ static void fill_tile4(AVCodecContext *avctx, int color, AVFrame *frame)
continue;
}
AV_WB24(&frame->data[0][frame->linesize[0] * (h - j) + 3 * k], color);
+ pixels_overwritten ++;
}
mask = mask << 1;
}
}
}
+ return pixels_overwritten;
}
-static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
+static int fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
int color, AVFrame *frame)
{
ARBCContext *s = avctx->priv_data;
@@ -79,9 +82,10 @@ static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
const int step_w = tile_width / 4;
int nb_tiles = bytestream2_get_le16(gb);
int h = avctx->height - 1;
+ int pixels_overwritten = 0;
if ((avctx->width / tile_width + 1) * (avctx->height / tile_height + 1) < nb_tiles)
- return;
+ return 0;
for (int i = 0; i < nb_tiles; i++) {
int y = bytestream2_get_byte(gb);
@@ -90,6 +94,9 @@ static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
int start_y = y * tile_height, start_x = x * tile_width;
int end_y = start_y + tile_height, end_x = start_x + tile_width;
+ if (start_x >= avctx->width || start_y >= avctx->height)
+ continue;
+
for (int j = start_y; j < end_y; j += step_h) {
for (int k = start_x; k < end_x; k += step_w) {
if (mask & 0x8000U) {
@@ -100,11 +107,13 @@ static void fill_tileX(AVCodecContext *avctx, int tile_width, int tile_height,
AV_WB24(&frame->data[0][frame->linesize[0] * (h - (j + m)) + 3 * (k + n)], color);
}
}
+ pixels_overwritten += FFMIN(step_h, avctx->height - j) * FFMIN(step_w, avctx->width - k);
}
mask = mask << 1;
}
}
}
+ return pixels_overwritten;
}
static int decode_frame(AVCodecContext *avctx, void *data,
@@ -112,7 +121,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
{
ARBCContext *s = avctx->priv_data;
AVFrame *frame = data;
- int ret, nb_segments, keyframe = 1;
+ int ret, nb_segments;
+ int prev_pixels = avctx->width * avctx->height;
if (avpkt->size < 10)
return AVERROR_INVALIDDATA;
@@ -121,7 +131,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
bytestream2_skip(&s->gb, 8);
nb_segments = bytestream2_get_le16(&s->gb);
if (nb_segments == 0)
- keyframe = 0;
+ return avpkt->size;
if (7 * nb_segments > bytestream2_get_bytes_left(&s->gb))
return AVERROR_INVALIDDATA;
@@ -151,23 +161,23 @@ static int decode_frame(AVCodecContext *avctx, void *data,
resolution_flag = bytestream2_get_byte(&s->gb);
if (resolution_flag & 0x10)
- fill_tileX(avctx, 1024, 1024, fill, frame);
+ prev_pixels -= fill_tileX(avctx, 1024, 1024, fill, frame);
if (resolution_flag & 0x08)
- fill_tileX(avctx, 256, 256, fill, frame);
+ prev_pixels -= fill_tileX(avctx, 256, 256, fill, frame);
if (resolution_flag & 0x04)
- fill_tileX(avctx, 64, 64, fill, frame);
+ prev_pixels -= fill_tileX(avctx, 64, 64, fill, frame);
if (resolution_flag & 0x02)
- fill_tileX(avctx, 16, 16, fill, frame);
+ prev_pixels -= fill_tileX(avctx, 16, 16, fill, frame);
if (resolution_flag & 0x01)
- fill_tile4(avctx, fill, frame);
+ prev_pixels -= fill_tile4(avctx, fill, frame);
}
av_frame_unref(s->prev_frame);
if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
return ret;
- frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
- frame->key_frame = keyframe;
+ frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
+ frame->key_frame = prev_pixels <= 0;
*got_frame = 1;
return avpkt->size;
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c
index 3e3bba801b9..9f964efb4dd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plus.c
@@ -81,8 +81,8 @@ av_cold void ff_atrac3p_init_vlcs(void)
{
int i, wl_vlc_offs, ct_vlc_offs, sf_vlc_offs, tab_offset;
- static const int wl_nb_bits[4] = { 2, 3, 5, 5 };
- static const int wl_nb_codes[4] = { 3, 5, 8, 8 };
+ static const uint8_t wl_nb_bits[4] = { 2, 3, 5, 5 };
+ static const uint8_t wl_nb_codes[4] = { 3, 5, 8, 8 };
static const uint8_t * const wl_bits[4] = {
atrac3p_wl_huff_bits1, atrac3p_wl_huff_bits2,
atrac3p_wl_huff_bits3, atrac3p_wl_huff_bits4
@@ -95,8 +95,8 @@ av_cold void ff_atrac3p_init_vlcs(void)
atrac3p_wl_huff_xlat1, atrac3p_wl_huff_xlat2, NULL, NULL
};
- static const int ct_nb_bits[4] = { 3, 4, 4, 4 };
- static const int ct_nb_codes[4] = { 4, 8, 8, 8 };
+ static const uint8_t ct_nb_bits[4] = { 3, 4, 4, 4 };
+ static const uint8_t ct_nb_codes[4] = { 4, 8, 8, 8 };
static const uint8_t * const ct_bits[4] = {
atrac3p_ct_huff_bits1, atrac3p_ct_huff_bits2,
atrac3p_ct_huff_bits2, atrac3p_ct_huff_bits3
@@ -109,8 +109,8 @@ av_cold void ff_atrac3p_init_vlcs(void)
NULL, NULL, atrac3p_ct_huff_xlat1, NULL
};
- static const int sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
- static const int sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
+ static const uint8_t sf_nb_bits[8] = { 9, 9, 9, 9, 6, 6, 7, 7 };
+ static const uint8_t sf_nb_codes[8] = { 64, 64, 64, 64, 16, 16, 16, 16 };
static const uint8_t * const 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,
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c
index 96aa402c2b2..ca3154e1337 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac3plusdsp.c
@@ -248,7 +248,7 @@ void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *f
out[i] += wavreg1[i] + wavreg2[i];
}
-static const int subband_to_powgrp[ATRAC3P_SUBBANDS] = {
+static const uint8_t subband_to_powgrp[ATRAC3P_SUBBANDS] = {
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4
};
@@ -411,7 +411,7 @@ static const float pwc_levs[16] = {
};
/** Map subband number to quant unit number. */
-static const int subband_to_qu[17] = {
+static const uint8_t subband_to_qu[17] = {
0, 8, 12, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/atrac9dec.c b/chromium/third_party/ffmpeg/libavcodec/atrac9dec.c
index 805d46f3b80..4d490daeb0f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/atrac9dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/atrac9dec.c
@@ -71,6 +71,8 @@ typedef struct ATRAC9BlockData {
int cpe_base_channel;
int is_signs[30];
+ int reuseable;
+
} ATRAC9BlockData;
typedef struct ATRAC9Context {
@@ -200,6 +202,8 @@ static inline int parse_band_ext(ATRAC9Context *s, ATRAC9BlockData *b,
int ext_band = 0;
if (b->has_band_ext) {
+ if (b->q_unit_cnt < 13)
+ return AVERROR_INVALIDDATA;
ext_band = at9_tab_band_ext_group[b->q_unit_cnt - 13][2];
if (stereo) {
b->channel[1].band_ext = get_bits(gb, 2);
@@ -241,7 +245,7 @@ static inline int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b,
ATRAC9ChannelData *c, GetBitContext *gb,
int channel_idx, int first_in_pkt)
{
- static const int mode_map[2][4] = { { 0, 1, 2, 3 }, { 0, 2, 3, 4 } };
+ static const uint8_t mode_map[2][4] = { { 0, 1, 2, 3 }, { 0, 2, 3, 4 } };
const int mode = mode_map[channel_idx][get_bits(gb, 2)];
memset(c->scalefactors, 0, sizeof(c->scalefactors));
@@ -668,6 +672,7 @@ static int atrac9_decode_block(ATRAC9Context *s, GetBitContext *gb,
if (!reuse_params) {
int stereo_band, ext_band;
const int min_band_count = s->samplerate_idx > 7 ? 1 : 3;
+ b->reuseable = 0;
b->band_count = get_bits(gb, 4) + min_band_count;
b->q_unit_cnt = at9_tab_band_q_unit_map[b->band_count];
@@ -699,6 +704,11 @@ static int atrac9_decode_block(ATRAC9Context *s, GetBitContext *gb,
}
b->band_ext_q_unit = at9_tab_band_q_unit_map[ext_band];
}
+ b->reuseable = 1;
+ }
+ if (!b->reuseable) {
+ av_log(s->avctx, AV_LOG_ERROR, "invalid block reused!\n");
+ return AVERROR_INVALIDDATA;
}
/* Calculate bit alloc gradient */
diff --git a/chromium/third_party/ffmpeg/libavcodec/av1_metadata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/av1_metadata_bsf.c
index fe208feaf5d..226f7dffa49 100644
--- a/chromium/third_party/ffmpeg/libavcodec/av1_metadata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/av1_metadata_bsf.c
@@ -116,24 +116,29 @@ static int av1_metadata_update_sequence_header(AVBSFContext *bsf,
return 0;
}
-static int av1_metadata_filter(AVBSFContext *bsf, AVPacket *out)
+static int av1_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
{
AV1MetadataContext *ctx = bsf->priv_data;
- AVPacket *in = NULL;
CodedBitstreamFragment *frag = &ctx->access_unit;
AV1RawOBU td, *obu;
int err, i;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->cbc, frag, in);
+ err = ff_cbs_read_packet(ctx->cbc, frag, pkt);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
goto fail;
}
+ if (frag->nb_units == 0) {
+ av_log(bsf, AV_LOG_ERROR, "No OBU in packet.\n");
+ err = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
for (i = 0; i < frag->nb_units; i++) {
if (frag->units[i].type == AV1_OBU_SEQUENCE_HEADER) {
obu = frag->units[i].content;
@@ -161,35 +166,24 @@ static int av1_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
if (ctx->delete_padding) {
- for (i = 0; i < frag->nb_units; i++) {
- if (frag->units[i].type == AV1_OBU_PADDING) {
- err = ff_cbs_delete_unit(ctx->cbc, frag, i);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete Padding OBU.\n");
- goto fail;
- }
- --i;
- }
+ for (i = frag->nb_units - 1; i >= 0; i--) {
+ if (frag->units[i].type == AV1_OBU_PADDING)
+ ff_cbs_delete_unit(ctx->cbc, frag, i);
}
}
- err = ff_cbs_write_packet(ctx->cbc, out, frag);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, frag);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
err = 0;
fail:
ff_cbs_fragment_reset(ctx->cbc, frag);
if (err < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/avcodec.h b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
index b7499466331..586bbbca4e9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avcodec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/avcodec.h
@@ -456,6 +456,7 @@ enum AVCodecID {
AV_CODEC_ID_ARBC,
AV_CODEC_ID_AGM,
AV_CODEC_ID_LSCR,
+ AV_CODEC_ID_VP4,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
diff --git a/chromium/third_party/ffmpeg/libavcodec/avpacket.c b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
index 8f0603df782..2b20067211b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/avpacket.c
+++ b/chromium/third_party/ffmpeg/libavcodec/avpacket.c
@@ -522,11 +522,12 @@ fail:
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
{
- const uint8_t *end = data + size;
+ const uint8_t *end;
int ret = 0;
if (!dict || !data || !size)
return ret;
+ end = data + size;
if (size && end[-1])
return AVERROR_INVALIDDATA;
while (data < end) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/bink.c b/chromium/third_party/ffmpeg/libavcodec/bink.c
index 6673afa7894..d18c0ceae4c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bink.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bink.c
@@ -702,15 +702,15 @@ static int read_dct_coeffs(BinkContext *c, GetBitContext *gb, int32_t block[64],
return quant_idx;
}
-static void unquantize_dct_coeffs(int32_t block[64], const int32_t quant[64],
+static void unquantize_dct_coeffs(int32_t block[64], const uint32_t quant[64],
int coef_count, int coef_idx[64],
const uint8_t *scan)
{
int i;
- block[0] = (block[0] * quant[0]) >> 11;
+ block[0] = (int)(block[0] * quant[0]) >> 11;
for (i = 0; i < coef_count; i++) {
int idx = coef_idx[i];
- block[scan[idx]] = (block[scan[idx]] * quant[idx]) >> 11;
+ block[scan[idx]] = (int)(block[scan[idx]] * quant[idx]) >> 11;
}
}
@@ -1046,8 +1046,6 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
if ((ret = read_runs(c->avctx, gb, &c->bundle[BINK_SRC_RUN])) < 0)
return ret;
- if (by == bh)
- break;
dst = frame->data[plane_idx] + 8*by*stride;
prev = (c->last->data[plane_idx] ? c->last->data[plane_idx]
: frame->data[plane_idx]) + 8*by*stride;
@@ -1335,13 +1333,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
c->avctx = avctx;
+ if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
+ return ret;
+
c->last = av_frame_alloc();
if (!c->last)
return AVERROR(ENOMEM);
- if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
- return ret;
-
avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
avctx->color_range = c->version == 'k' ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
diff --git a/chromium/third_party/ffmpeg/libavcodec/binkdsp.c b/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
index 9d70e2326fd..a357d316720 100644
--- a/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/binkdsp.c
@@ -33,20 +33,22 @@
#define A3 3784
#define A4 -5352
+#define MUL(X,Y) ((int)((unsigned)(X) * (Y)) >> 11)
+
#define IDCT_TRANSFORM(dest,s0,s1,s2,s3,s4,s5,s6,s7,d0,d1,d2,d3,d4,d5,d6,d7,munge,src) {\
const int a0 = (src)[s0] + (src)[s4]; \
const int a1 = (src)[s0] - (src)[s4]; \
const int a2 = (src)[s2] + (src)[s6]; \
- const int a3 = (A1*((src)[s2] - (src)[s6])) >> 11; \
+ const int a3 = MUL(A1, (src)[s2] - (src)[s6]); \
const int a4 = (src)[s5] + (src)[s3]; \
const int a5 = (src)[s5] - (src)[s3]; \
const int a6 = (src)[s1] + (src)[s7]; \
const int a7 = (src)[s1] - (src)[s7]; \
const int b0 = a4 + a6; \
- const int b1 = (A3*(a5 + a7)) >> 11; \
- const int b2 = ((A4*a5) >> 11) - b0 + b1; \
- const int b3 = (A1*(a6 - a4) >> 11) - b2; \
- const int b4 = ((A2*a7) >> 11) + b3 - b1; \
+ const int b1 = MUL(A3, a5 + a7); \
+ const int b2 = MUL(A4, a5) - b0 + b1; \
+ const int b3 = MUL(A1, a6 - a4) - b2; \
+ const int b4 = MUL(A2, a7) + b3 - b1; \
(dest)[d0] = munge(a0+a2 +b0); \
(dest)[d1] = munge(a1+a3-a2+b2); \
(dest)[d2] = munge(a1-a3+a2+b3); \
diff --git a/chromium/third_party/ffmpeg/libavcodec/bintext.c b/chromium/third_party/ffmpeg/libavcodec/bintext.c
index d85f2c2dd44..1aeed21f516 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bintext.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bintext.c
@@ -63,6 +63,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
return AVERROR_INVALIDDATA;
}
+ if (!s->font_height) {
+ av_log(avctx, AV_LOG_ERROR, "invalid font height\n");
+ return AVERROR_INVALIDDATA;
+ }
} else {
s->font_height = 8;
s->flags = 0;
@@ -93,8 +97,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
break;
}
}
- if (avctx->width < FONT_WIDTH || avctx->height < s->font_height)
+ if (avctx->width < FONT_WIDTH || avctx->height < s->font_height) {
+ av_log(avctx, AV_LOG_ERROR, "Resolution too small for font.\n");
return AVERROR_INVALIDDATA;
+ }
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/bitstream.c b/chromium/third_party/ffmpeg/libavcodec/bitstream.c
index 8762e5f4b2f..be8a0f634dc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/bitstream.c
+++ b/chromium/third_party/ffmpeg/libavcodec/bitstream.c
@@ -188,8 +188,9 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
}
for (k = 0; k < nb; k++) {
int bits = table[j][1];
+ int oldsym = table[j][0];
ff_dlog(NULL, "%4x: code=%d n=%d\n", j, i, n);
- if (bits != 0 && bits != n) {
+ if ((bits || oldsym) && (bits != n || oldsym != symbol)) {
av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
return AVERROR_INVALIDDATA;
}
@@ -226,6 +227,10 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
/* note: realloc has been done, so reload tables */
table = (volatile VLC_TYPE (*)[2])&vlc->table[table_index];
table[j][0] = index; //code
+ if (table[j][0] != index) {
+ avpriv_request_sample(NULL, "strange codes");
+ return AVERROR_PATCHWELCOME;
+ }
i = k-1;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs.c b/chromium/third_party/ffmpeg/libavcodec/cbs.c
index 0260ba6f67a..23504165017 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs.c
@@ -357,7 +357,8 @@ int ff_cbs_write_packet(CodedBitstreamContext *ctx,
if (!buf)
return AVERROR(ENOMEM);
- av_init_packet(pkt);
+ av_buffer_unref(&pkt->buf);
+
pkt->buf = buf;
pkt->data = frag->data;
pkt->size = frag->data_size;
@@ -736,12 +737,12 @@ int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
return 0;
}
-int ff_cbs_delete_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
- int position)
+void ff_cbs_delete_unit(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *frag,
+ int position)
{
- if (position < 0 || position >= frag->nb_units)
- return AVERROR(EINVAL);
+ av_assert0(0 <= position && position < frag->nb_units
+ && "Unit to be deleted not in fragment.");
cbs_unit_uninit(ctx, &frag->units[position]);
@@ -751,6 +752,4 @@ int ff_cbs_delete_unit(CodedBitstreamContext *ctx,
memmove(frag->units + position,
frag->units + position + 1,
(frag->nb_units - position) * sizeof(*frag->units));
-
- return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs.h b/chromium/third_party/ffmpeg/libavcodec/cbs.h
index 967dcd14686..fe57e7b2a57 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs.h
@@ -297,7 +297,8 @@ int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx,
/**
* Write the bitstream of a fragment to the extradata in codec parameters.
*
- * This replaces any existing extradata in the structure.
+ * Modifies context and fragment as ff_cbs_write_fragment_data does and
+ * replaces any existing extradata in the structure.
*/
int ff_cbs_write_extradata(CodedBitstreamContext *ctx,
AVCodecParameters *par,
@@ -305,6 +306,13 @@ int ff_cbs_write_extradata(CodedBitstreamContext *ctx,
/**
* Write the bitstream of a fragment to a packet.
+ *
+ * Modifies context and fragment as ff_cbs_write_fragment_data does.
+ *
+ * On success, the packet's buf is unreferenced and its buf, data and
+ * size fields are set to the corresponding values from the newly updated
+ * fragment; other fields are not touched. On failure, the packet is not
+ * touched at all.
*/
int ff_cbs_write_packet(CodedBitstreamContext *ctx,
AVPacket *pkt,
@@ -372,10 +380,12 @@ int ff_cbs_insert_unit_data(CodedBitstreamContext *ctx,
/**
* Delete a unit from a fragment and free all memory it uses.
+ *
+ * Requires position to be >= 0 and < frag->nb_units.
*/
-int ff_cbs_delete_unit(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *frag,
- int position);
+void ff_cbs_delete_unit(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *frag,
+ int position);
#endif /* AVCODEC_CBS_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_av1.c b/chromium/third_party/ffmpeg/libavcodec/cbs_av1.c
index eb2d03ef436..eb6b8017902 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_av1.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_av1.c
@@ -648,7 +648,6 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc)
#undef xf
#undef xsu
#undef uvlc
-#undef leb128
#undef ns
#undef increment
#undef subexp
@@ -720,17 +719,17 @@ static size_t cbs_av1_get_payload_bytes_left(GetBitContext *gbc)
#include "cbs_av1_syntax_template.c"
-#undef READ
+#undef WRITE
#undef READWRITE
#undef RWContext
#undef xf
#undef xsu
#undef uvlc
-#undef leb128
#undef ns
#undef increment
#undef subexp
#undef delta_q
+#undef leb128
#undef infer
#undef byte_alignment
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c b/chromium/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c
index 59a98b18c94..b04cd51d558 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_av1_syntax_template.c
@@ -1753,19 +1753,19 @@ static int FUNC(metadata_timecode)(CodedBitstreamContext *ctx, RWContext *rw,
fb(9, n_frames);
if (current->full_timestamp_flag) {
- fb(6, seconds_value);
- fb(6, minutes_value);
- fb(5, hours_value);
+ fc(6, seconds_value, 0, 59);
+ fc(6, minutes_value, 0, 59);
+ fc(5, hours_value, 0, 23);
} else {
flag(seconds_flag);
if (current->seconds_flag) {
- fb(6, seconds_value);
+ fc(6, seconds_value, 0, 59);
flag(minutes_flag);
if (current->minutes_flag) {
- fb(6, minutes_value);
+ fc(6, minutes_value, 0, 59);
flag(hours_flag);
if (current->hours_flag)
- fb(5, hours_value);
+ fc(5, hours_value, 0, 23);
}
}
}
@@ -1773,6 +1773,8 @@ static int FUNC(metadata_timecode)(CodedBitstreamContext *ctx, RWContext *rw,
fb(5, time_offset_length);
if (current->time_offset_length > 0)
fb(current->time_offset_length, time_offset_value);
+ else
+ infer(time_offset_length, 0);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_h264.h b/chromium/third_party/ffmpeg/libavcodec/cbs_h264.h
index b5eee7c3702..b39e7480c98 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_h264.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_h264.h
@@ -38,7 +38,6 @@ enum {
typedef struct H264RawNALUnitHeader {
- uint8_t forbidden_zero_bit;
uint8_t nal_ref_idc;
uint8_t nal_unit_type;
@@ -315,6 +314,10 @@ typedef struct H264RawSEIMasteringDisplayColourVolume {
uint32_t min_display_mastering_luminance;
} H264RawSEIMasteringDisplayColourVolume;
+typedef struct H264RawSEIAlternativeTransferCharacteristics {
+ uint8_t preferred_transfer_characteristics;
+} H264RawSEIAlternativeTransferCharacteristics;
+
typedef struct H264RawSEIPayload {
uint32_t payload_type;
uint32_t payload_size;
@@ -328,6 +331,8 @@ typedef struct H264RawSEIPayload {
H264RawSEIRecoveryPoint recovery_point;
H264RawSEIDisplayOrientation display_orientation;
H264RawSEIMasteringDisplayColourVolume mastering_display_colour_volume;
+ H264RawSEIAlternativeTransferCharacteristics
+ alternative_transfer_characteristics;
struct {
uint8_t *data;
size_t data_length;
@@ -473,10 +478,13 @@ int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx,
*
* Deletes from nal_unit, which must be an SEI NAL unit. If this is the
* last message in nal_unit, also deletes it from access_unit.
+ *
+ * Requires nal_unit to be a unit in access_unit and position to be >= 0
+ * and < the payload count of the SEI nal_unit.
*/
-int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *access_unit,
- CodedBitstreamUnit *nal_unit,
- int position);
+void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *access_unit,
+ CodedBitstreamUnit *nal_unit,
+ int position);
#endif /* AVCODEC_CBS_H264_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_h2645.c b/chromium/third_party/ffmpeg/libavcodec/cbs_h2645.c
index a205293b3c2..da4927ca8e2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_h2645.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_h2645.c
@@ -24,7 +24,6 @@
#include "cbs_internal.h"
#include "cbs_h264.h"
#include "cbs_h265.h"
-#include "golomb.h"
#include "h264.h"
#include "h264_sei.h"
#include "h2645_parse.h"
@@ -252,22 +251,30 @@ static int cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc,
#define u(width, name, range_min, range_max) \
xu(width, name, current->name, range_min, range_max, 0)
-#define flag(name) u(1, name, 0, 1)
+#define ub(width, name) \
+ xu(width, name, current->name, 0, MAX_UINT_BITS(width), 0)
+#define flag(name) ub(1, name)
#define ue(name, range_min, range_max) \
xue(name, current->name, range_min, range_max, 0)
#define i(width, name, range_min, range_max) \
xi(width, name, current->name, range_min, range_max, 0)
+#define ib(width, name) \
+ xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), 0)
#define se(name, range_min, range_max) \
xse(name, current->name, range_min, range_max, 0)
#define us(width, name, range_min, range_max, subs, ...) \
xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
+#define ubs(width, name, subs, ...) \
+ xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
#define flags(name, subs, ...) \
xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)
#define ues(name, range_min, range_max, subs, ...) \
xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)
#define is(width, name, range_min, range_max, subs, ...) \
xi(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
+#define ibs(width, name, subs, ...) \
+ xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), subs, __VA_ARGS__)
#define ses(name, range_min, range_max, subs, ...) \
xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)
@@ -450,6 +457,7 @@ static void cbs_h264_free_sei_payload(H264RawSEIPayload *payload)
case H264_SEI_TYPE_RECOVERY_POINT:
case H264_SEI_TYPE_DISPLAY_ORIENTATION:
case H264_SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME:
+ case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
break;
case H264_SEI_TYPE_USER_DATA_REGISTERED:
av_buffer_unref(&payload->payload.user_data_registered.data_ref);
@@ -1635,10 +1643,10 @@ int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx,
return 0;
}
-int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
- CodedBitstreamFragment *au,
- CodedBitstreamUnit *nal,
- int position)
+void ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
+ CodedBitstreamFragment *au,
+ CodedBitstreamUnit *nal,
+ int position)
{
H264RawSEI *sei = nal->content;
@@ -1653,9 +1661,8 @@ int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
if (&au->units[i] == nal)
break;
}
- av_assert0(i < au->nb_units && "NAL unit not in access unit.");
- return ff_cbs_delete_unit(ctx, au, i);
+ ff_cbs_delete_unit(ctx, au, i);
} else {
cbs_h264_free_sei_payload(&sei->payload[position]);
@@ -1663,7 +1670,5 @@ int ff_cbs_h264_delete_sei_message(CodedBitstreamContext *ctx,
memmove(sei->payload + position,
sei->payload + position + 1,
(sei->payload_count - position) * sizeof(*sei->payload));
-
- return 0;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_h264_syntax_template.c b/chromium/third_party/ffmpeg/libavcodec/cbs_h264_syntax_template.c
index 07b4cddb5e6..26be6e590fb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_h264_syntax_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_h264_syntax_template.c
@@ -33,9 +33,9 @@ static int FUNC(nal_unit_header)(CodedBitstreamContext *ctx, RWContext *rw,
{
int err;
- u(1, forbidden_zero_bit, 0, 0);
- u(2, nal_ref_idc, 0, 3);
- u(5, nal_unit_type, 0, 31);
+ fixed(1, forbidden_zero_bit, 0);
+ ub(2, nal_ref_idc);
+ ub(5, nal_unit_type);
if (!(1 << current->nal_unit_type & valid_type_mask)) {
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid NAL unit type %d.\n",
@@ -91,8 +91,8 @@ static int FUNC(hrd_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
int err, i;
ue(cpb_cnt_minus1, 0, 31);
- u(4, bit_rate_scale, 0, 15);
- u(4, cpb_size_scale, 0, 15);
+ ub(4, bit_rate_scale);
+ ub(4, cpb_size_scale);
for (i = 0; i <= current->cpb_cnt_minus1; i++) {
ues(bit_rate_value_minus1[i], 0, UINT32_MAX - 1, 1, i);
@@ -100,10 +100,10 @@ static int FUNC(hrd_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
flags(cbr_flag[i], 1, i);
}
- u(5, initial_cpb_removal_delay_length_minus1, 0, 31);
- u(5, cpb_removal_delay_length_minus1, 0, 31);
- u(5, dpb_output_delay_length_minus1, 0, 31);
- u(5, time_offset_length, 0, 31);
+ ub(5, initial_cpb_removal_delay_length_minus1);
+ ub(5, cpb_removal_delay_length_minus1);
+ ub(5, dpb_output_delay_length_minus1);
+ ub(5, time_offset_length);
return 0;
}
@@ -115,10 +115,10 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
flag(aspect_ratio_info_present_flag);
if (current->aspect_ratio_info_present_flag) {
- u(8, aspect_ratio_idc, 0, 255);
+ ub(8, aspect_ratio_idc);
if (current->aspect_ratio_idc == 255) {
- u(16, sar_width, 0, 65535);
- u(16, sar_height, 0, 65535);
+ ub(16, sar_width);
+ ub(16, sar_height);
}
} else {
infer(aspect_ratio_idc, 0);
@@ -130,13 +130,13 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
flag(video_signal_type_present_flag);
if (current->video_signal_type_present_flag) {
- u(3, video_format, 0, 7);
+ ub(3, video_format);
flag(video_full_range_flag);
flag(colour_description_present_flag);
if (current->colour_description_present_flag) {
- u(8, colour_primaries, 0, 255);
- u(8, transfer_characteristics, 0, 255);
- u(8, matrix_coefficients, 0, 255);
+ ub(8, colour_primaries);
+ ub(8, transfer_characteristics);
+ ub(8, matrix_coefficients);
}
} else {
infer(video_format, 5);
@@ -263,7 +263,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header,
1 << H264_NAL_SPS));
- u(8, profile_idc, 0, 255);
+ ub(8, profile_idc);
flag(constraint_set0_flag);
flag(constraint_set1_flag);
@@ -274,7 +274,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
u(2, reserved_zero_2bits, 0, 0);
- u(8, level_idc, 0, 255);
+ ub(8, level_idc);
ue(seq_parameter_set_id, 0, 31);
@@ -386,8 +386,8 @@ static int FUNC(sps_extension)(CodedBitstreamContext *ctx, RWContext *rw,
flag(alpha_incr_flag);
bits = current->bit_depth_aux_minus8 + 9;
- u(bits, alpha_opaque_value, 0, MAX_UINT_BITS(bits));
- u(bits, alpha_transparent_value, 0, MAX_UINT_BITS(bits));
+ ub(bits, alpha_opaque_value);
+ ub(bits, alpha_transparent_value);
}
flag(additional_extension_flag);
@@ -565,7 +565,7 @@ static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
flag(full_timestamp_flag);
flag(discontinuity_flag);
flag(cnt_dropped_flag);
- u(8, n_frames, 0, 255);
+ ub(8, n_frames);
if (current->full_timestamp_flag) {
u(6, seconds_value, 0, 59);
u(6, minutes_value, 0, 59);
@@ -592,9 +592,7 @@ static int FUNC(sei_pic_timestamp)(CodedBitstreamContext *ctx, RWContext *rw,
time_offset_length = 24;
if (time_offset_length > 0)
- i(time_offset_length, time_offset,
- MIN_INT_BITS(time_offset_length),
- MAX_INT_BITS(time_offset_length));
+ ib(time_offset_length, time_offset);
else
infer(time_offset, 0);
@@ -647,14 +645,12 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
return AVERROR_INVALIDDATA;
}
- u(hrd->cpb_removal_delay_length_minus1 + 1, cpb_removal_delay,
- 0, MAX_UINT_BITS(hrd->cpb_removal_delay_length_minus1 + 1));
- u(hrd->dpb_output_delay_length_minus1 + 1, dpb_output_delay,
- 0, MAX_UINT_BITS(hrd->dpb_output_delay_length_minus1 + 1));
+ ub(hrd->cpb_removal_delay_length_minus1 + 1, cpb_removal_delay);
+ ub(hrd->dpb_output_delay_length_minus1 + 1, dpb_output_delay);
}
if (sps->vui.pic_struct_present_flag) {
- static const int num_clock_ts[9] = {
+ static const uint8_t num_clock_ts[9] = {
1, 1, 1, 2, 2, 3, 3, 2, 3
};
int i;
@@ -790,7 +786,7 @@ static int FUNC(sei_display_orientation)(CodedBitstreamContext *ctx, RWContext *
if (!current->display_orientation_cancel_flag) {
flag(hor_flip);
flag(ver_flip);
- u(16, anticlockwise_rotation, 0, 65535);
+ ub(16, anticlockwise_rotation);
ue(display_orientation_repetition_period, 0, 16384);
flag(display_orientation_extension_flag);
}
@@ -819,6 +815,19 @@ static int FUNC(sei_mastering_display_colour_volume)(CodedBitstreamContext *ctx,
return 0;
}
+static int FUNC(sei_alternative_transfer_characteristics)(CodedBitstreamContext *ctx,
+ RWContext *rw,
+ H264RawSEIAlternativeTransferCharacteristics *current)
+{
+ int err;
+
+ HEADER("Alternative Transfer Characteristics");
+
+ ub(8, preferred_transfer_characteristics);
+
+ return 0;
+}
+
static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
H264RawSEIPayload *current)
{
@@ -870,6 +879,10 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(sei_mastering_display_colour_volume)
(ctx, rw, &current->payload.mastering_display_colour_volume));
break;
+ case H264_SEI_TYPE_ALTERNATIVE_TRANSFER:
+ CHECK(FUNC(sei_alternative_transfer_characteristics)
+ (ctx, rw, &current->payload.alternative_transfer_characteristics));
+ break;
default:
{
#ifdef READ
@@ -996,7 +1009,7 @@ static int FUNC(aud)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header,
1 << H264_NAL_AUD));
- u(3, primary_pic_type, 0, 7);
+ ub(3, primary_pic_type);
CHECK(FUNC(rbsp_trailing_bits)(ctx, rw));
@@ -1232,8 +1245,7 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
if (sps->separate_colour_plane_flag)
u(2, colour_plane_id, 0, 2);
- u(sps->log2_max_frame_num_minus4 + 4, frame_num,
- 0, MAX_UINT_BITS(sps->log2_max_frame_num_minus4 + 4));
+ ub(sps->log2_max_frame_num_minus4 + 4, frame_num);
if (!sps->frame_mbs_only_flag) {
flag(field_pic_flag);
@@ -1250,8 +1262,7 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
ue(idr_pic_id, 0, 65535);
if (sps->pic_order_cnt_type == 0) {
- u(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, pic_order_cnt_lsb,
- 0, MAX_UINT_BITS(sps->log2_max_pic_order_cnt_lsb_minus4 + 4));
+ ub(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, pic_order_cnt_lsb);
if (pps->bottom_field_pic_order_in_frame_present_flag &&
!current->field_pic_flag)
se(delta_pic_order_cnt_bottom, INT32_MIN + 1, INT32_MAX);
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_h265.h b/chromium/third_party/ffmpeg/libavcodec/cbs_h265.h
index 0c0e4f84b06..c9bc90187b0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_h265.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_h265.h
@@ -35,7 +35,6 @@ enum {
};
typedef struct H265RawNALUnitHeader {
- uint8_t forbidden_zero_bit;
uint8_t nal_unit_type;
uint8_t nuh_layer_id;
uint8_t nuh_temporal_id_plus1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_h265_syntax_template.c b/chromium/third_party/ffmpeg/libavcodec/cbs_h265_syntax_template.c
index bbd363a3895..f279d283d9b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_h265_syntax_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_h265_syntax_template.c
@@ -33,13 +33,13 @@ static int FUNC(nal_unit_header)(CodedBitstreamContext *ctx, RWContext *rw,
{
int err;
- u(1, forbidden_zero_bit, 0, 0);
+ fixed(1, forbidden_zero_bit, 0);
if (expected_nal_unit_type >= 0)
u(6, nal_unit_type, expected_nal_unit_type,
expected_nal_unit_type);
else
- u(6, nal_unit_type, 0, 63);
+ ub(6, nal_unit_type);
u(6, nuh_layer_id, 0, 62);
u(3, nuh_temporal_id_plus1, 1, 7);
@@ -95,7 +95,7 @@ static int FUNC(profile_tier_level)(CodedBitstreamContext *ctx, RWContext *rw,
if (profile_present_flag) {
u(2, general_profile_space, 0, 0);
flag(general_tier_flag);
- u(5, general_profile_idc, 0, 31);
+ ub(5, general_profile_idc);
for (j = 0; j < 32; j++)
flags(general_profile_compatibility_flag[j], 1, j);
@@ -150,7 +150,7 @@ static int FUNC(profile_tier_level)(CodedBitstreamContext *ctx, RWContext *rw,
#undef profile_compatible
}
- u(8, general_level_idc, 0, 255);
+ ub(8, general_level_idc);
for (i = 0; i < max_num_sub_layers_minus1; i++) {
flags(sub_layer_profile_present_flag[i], 1, i);
@@ -166,7 +166,7 @@ static int FUNC(profile_tier_level)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->sub_layer_profile_present_flag[i]) {
us(2, sub_layer_profile_space[i], 0, 0, 1, i);
flags(sub_layer_tier_flag[i], 1, i);
- us(5, sub_layer_profile_idc[i], 0, 31, 1, i);
+ ubs(5, sub_layer_profile_idc[i], 1, i);
for (j = 0; j < 32; j++)
flags(sub_layer_profile_compatibility_flag[i][j], 2, i, j);
@@ -220,7 +220,7 @@ static int FUNC(profile_tier_level)(CodedBitstreamContext *ctx, RWContext *rw,
#undef profile_compatible
}
if (current->sub_layer_level_present_flag[i])
- us(8, sub_layer_level_idc[i], 0, 255, 1, i);
+ ubs(8, sub_layer_level_idc[i], 1, i);
}
return 0;
@@ -265,20 +265,20 @@ static int FUNC(hrd_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
current->vcl_hrd_parameters_present_flag) {
flag(sub_pic_hrd_params_present_flag);
if (current->sub_pic_hrd_params_present_flag) {
- u(8, tick_divisor_minus2, 0, 255);
- u(5, du_cpb_removal_delay_increment_length_minus1, 0, 31);
+ ub(8, tick_divisor_minus2);
+ ub(5, du_cpb_removal_delay_increment_length_minus1);
flag(sub_pic_cpb_params_in_pic_timing_sei_flag);
- u(5, dpb_output_delay_du_length_minus1, 0, 31);
+ ub(5, dpb_output_delay_du_length_minus1);
}
- u(4, bit_rate_scale, 0, 15);
- u(4, cpb_size_scale, 0, 15);
+ ub(4, bit_rate_scale);
+ ub(4, cpb_size_scale);
if (current->sub_pic_hrd_params_present_flag)
- u(4, cpb_size_du_scale, 0, 15);
+ ub(4, cpb_size_du_scale);
- u(5, initial_cpb_removal_delay_length_minus1, 0, 31);
- u(5, au_cpb_removal_delay_length_minus1, 0, 31);
- u(5, dpb_output_delay_length_minus1, 0, 31);
+ ub(5, initial_cpb_removal_delay_length_minus1);
+ ub(5, au_cpb_removal_delay_length_minus1);
+ ub(5, dpb_output_delay_length_minus1);
} else {
infer(sub_pic_hrd_params_present_flag, 0);
@@ -323,10 +323,10 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
flag(aspect_ratio_info_present_flag);
if (current->aspect_ratio_info_present_flag) {
- u(8, aspect_ratio_idc, 0, 255);
+ ub(8, aspect_ratio_idc);
if (current->aspect_ratio_idc == 255) {
- u(16, sar_width, 0, 65535);
- u(16, sar_height, 0, 65535);
+ ub(16, sar_width);
+ ub(16, sar_height);
}
} else {
infer(aspect_ratio_idc, 0);
@@ -338,13 +338,13 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
flag(video_signal_type_present_flag);
if (current->video_signal_type_present_flag) {
- u(3, video_format, 0, 7);
+ ub(3, video_format);
flag(video_full_range_flag);
flag(colour_description_present_flag);
if (current->colour_description_present_flag) {
- u(8, colour_primaries, 0, 255);
- u(8, transfer_characteristics, 0, 255);
- u(8, matrix_coefficients, 0, 255);
+ ub(8, colour_primaries);
+ ub(8, transfer_characteristics);
+ ub(8, matrix_coefficients);
} else {
infer(colour_primaries, 2);
infer(transfer_characteristics, 2);
@@ -426,7 +426,7 @@ static int FUNC(vps)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_VPS));
- u(4, vps_video_parameter_set_id, 0, 15);
+ ub(4, vps_video_parameter_set_id);
flag(vps_base_layer_internal_flag);
flag(vps_base_layer_available_flag);
@@ -723,8 +723,7 @@ static int FUNC(sps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
int bit_depth = comp == 0 ? current->bit_depth_luma_minus8 + 8
: current->bit_depth_chroma_minus8 + 8;
for (i = 0; i <= current->sps_num_palette_predictor_initializer_minus1; i++)
- us(bit_depth, sps_palette_predictor_initializers[comp][i],
- 0, MAX_UINT_BITS(bit_depth), 2, comp, i);
+ ubs(bit_depth, sps_palette_predictor_initializers[comp][i], 2, comp, i);
}
}
}
@@ -748,7 +747,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(nal_unit_header)(ctx, rw, &current->nal_unit_header, HEVC_NAL_SPS));
- u(4, sps_video_parameter_set_id, 0, 15);
+ ub(4, sps_video_parameter_set_id);
h265->active_vps = vps = h265->vps[current->sps_video_parameter_set_id];
u(3, sps_max_sub_layers_minus1, 0, HEVC_MAX_SUB_LAYERS - 1);
@@ -887,9 +886,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->long_term_ref_pics_present_flag) {
ue(num_long_term_ref_pics_sps, 0, HEVC_MAX_LONG_TERM_REF_PICS);
for (i = 0; i < current->num_long_term_ref_pics_sps; i++) {
- us(current->log2_max_pic_order_cnt_lsb_minus4 + 4,
- lt_ref_pic_poc_lsb_sps[i],
- 0, MAX_UINT_BITS(current->log2_max_pic_order_cnt_lsb_minus4 + 4), 1, i);
+ ubs(current->log2_max_pic_order_cnt_lsb_minus4 + 4,
+ lt_ref_pic_poc_lsb_sps[i], 1, i);
flags(used_by_curr_pic_lt_sps_flag[i], 1, i);
}
}
@@ -907,7 +905,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
flag(sps_multilayer_extension_flag);
flag(sps_3d_extension_flag);
flag(sps_scc_extension_flag);
- u(4, sps_extension_4bits, 0, MAX_UINT_BITS(4));
+ ub(4, sps_extension_4bits);
}
if (current->sps_range_extension_flag)
@@ -986,8 +984,7 @@ static int FUNC(pps_scc_extension)(CodedBitstreamContext *ctx, RWContext *rw,
int bit_depth = comp == 0 ? current->luma_bit_depth_entry_minus8 + 8
: current->chroma_bit_depth_entry_minus8 + 8;
for (i = 0; i < current->pps_num_palette_predictor_initializer; i++)
- us(bit_depth, pps_palette_predictor_initializers[comp][i],
- 0, MAX_UINT_BITS(bit_depth), 2, comp, i);
+ ubs(bit_depth, pps_palette_predictor_initializers[comp][i], 2, comp, i);
}
}
}
@@ -1018,7 +1015,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw,
flag(dependent_slice_segments_enabled_flag);
flag(output_flag_present_flag);
- u(3, num_extra_slice_header_bits, 0, 7);
+ ub(3, num_extra_slice_header_bits);
flag(sign_data_hiding_enabled_flag);
flag(cabac_init_present_flag);
@@ -1100,7 +1097,7 @@ static int FUNC(pps)(CodedBitstreamContext *ctx, RWContext *rw,
flag(pps_multilayer_extension_flag);
flag(pps_3d_extension_flag);
flag(pps_scc_extension_flag);
- u(4, pps_extension_4bits, 0, MAX_UINT_BITS(4));
+ ub(4, pps_extension_4bits);
}
if (current->pps_range_extension_flag)
CHECK(FUNC(pps_range_extension)(ctx, rw, current));
@@ -1335,8 +1332,7 @@ static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
current->nal_unit_header.nal_unit_type != HEVC_NAL_IDR_N_LP) {
const H265RawSTRefPicSet *rps;
- u(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, slice_pic_order_cnt_lsb,
- 0, MAX_UINT_BITS(sps->log2_max_pic_order_cnt_lsb_minus4 + 4));
+ ub(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, slice_pic_order_cnt_lsb);
flag(short_term_ref_pic_set_sps_flag);
if (!current->short_term_ref_pic_set_sps_flag) {
@@ -1382,8 +1378,7 @@ static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
if (sps->used_by_curr_pic_lt_sps_flag[current->lt_idx_sps[i]])
++num_pic_total_curr;
} else {
- us(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, poc_lsb_lt[i],
- 0, MAX_UINT_BITS(sps->log2_max_pic_order_cnt_lsb_minus4 + 4), 1, i);
+ ubs(sps->log2_max_pic_order_cnt_lsb_minus4 + 4, poc_lsb_lt[i], 1, i);
flags(used_by_curr_pic_lt_flag[i], 1, i);
if (current->used_by_curr_pic_lt_flag[i])
++num_pic_total_curr;
@@ -1548,8 +1543,7 @@ static int FUNC(slice_segment_header)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->num_entry_point_offsets > 0) {
ue(offset_len_minus1, 0, 31);
for (i = 0; i < current->num_entry_point_offsets; i++)
- us(current->offset_len_minus1 + 1, entry_point_offset_minus1[i],
- 0, MAX_UINT_BITS(current->offset_len_minus1 + 1), 1, i);
+ ubs(current->offset_len_minus1 + 1, entry_point_offset_minus1[i], 1, i);
}
}
@@ -1610,9 +1604,9 @@ static int FUNC(sei_buffering_period)(CodedBitstreamContext *ctx, RWContext *rw,
infer(irap_cpb_params_present_flag, 0);
if (current->irap_cpb_params_present_flag) {
length = hrd->au_cpb_removal_delay_length_minus1 + 1;
- u(length, cpb_delay_offset, 0, MAX_UINT_BITS(length));
+ ub(length, cpb_delay_offset);
length = hrd->dpb_output_delay_length_minus1 + 1;
- u(length, dpb_delay_offset, 0, MAX_UINT_BITS(length));
+ ub(length, dpb_delay_offset);
} else {
infer(cpb_delay_offset, 0);
infer(dpb_delay_offset, 0);
@@ -1621,23 +1615,19 @@ static int FUNC(sei_buffering_period)(CodedBitstreamContext *ctx, RWContext *rw,
flag(concatenation_flag);
length = hrd->au_cpb_removal_delay_length_minus1 + 1;
- u(length, au_cpb_removal_delay_delta_minus1, 0, MAX_UINT_BITS(length));
+ ub(length, au_cpb_removal_delay_delta_minus1);
if (hrd->nal_hrd_parameters_present_flag) {
for (i = 0; i <= hrd->cpb_cnt_minus1[0]; i++) {
length = hrd->initial_cpb_removal_delay_length_minus1 + 1;
- us(length, nal_initial_cpb_removal_delay[i],
- 0, MAX_UINT_BITS(length), 1, i);
- us(length, nal_initial_cpb_removal_offset[i],
- 0, MAX_UINT_BITS(length), 1, i);
+ ubs(length, nal_initial_cpb_removal_delay[i], 1, i);
+ ubs(length, nal_initial_cpb_removal_offset[i], 1, i);
if (hrd->sub_pic_hrd_params_present_flag ||
current->irap_cpb_params_present_flag) {
- us(length, nal_initial_alt_cpb_removal_delay[i],
- 0, MAX_UINT_BITS(length), 1, i);
- us(length, nal_initial_alt_cpb_removal_offset[i],
- 0, MAX_UINT_BITS(length), 1, i);
+ ubs(length, nal_initial_alt_cpb_removal_delay[i], 1, i);
+ ubs(length, nal_initial_alt_cpb_removal_offset[i], 1, i);
}
}
}
@@ -1645,17 +1635,13 @@ static int FUNC(sei_buffering_period)(CodedBitstreamContext *ctx, RWContext *rw,
for (i = 0; i <= hrd->cpb_cnt_minus1[0]; i++) {
length = hrd->initial_cpb_removal_delay_length_minus1 + 1;
- us(length, vcl_initial_cpb_removal_delay[i],
- 0, MAX_UINT_BITS(length), 1, i);
- us(length, vcl_initial_cpb_removal_offset[i],
- 0, MAX_UINT_BITS(length), 1, i);
+ ubs(length, vcl_initial_cpb_removal_delay[i], 1, i);
+ ubs(length, vcl_initial_cpb_removal_offset[i], 1, i);
if (hrd->sub_pic_hrd_params_present_flag ||
current->irap_cpb_params_present_flag) {
- us(length, vcl_initial_alt_cpb_removal_delay[i],
- 0, MAX_UINT_BITS(length), 1, i);
- us(length, vcl_initial_alt_cpb_removal_offset[i],
- 0, MAX_UINT_BITS(length), 1, i);
+ ubs(length, vcl_initial_alt_cpb_removal_delay[i], 1, i);
+ ubs(length, vcl_initial_alt_cpb_removal_offset[i], 1, i);
}
}
}
@@ -1720,14 +1706,14 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
if (hrd && (hrd->nal_hrd_parameters_present_flag ||
hrd->vcl_hrd_parameters_present_flag)) {
length = hrd->au_cpb_removal_delay_length_minus1 + 1;
- u(length, au_cpb_removal_delay_minus1, 0, MAX_UINT_BITS(length));
+ ub(length, au_cpb_removal_delay_minus1);
length = hrd->dpb_output_delay_length_minus1 + 1;
- u(length, pic_dpb_output_delay, 0, MAX_UINT_BITS(length));
+ ub(length, pic_dpb_output_delay);
if (hrd->sub_pic_hrd_params_present_flag) {
length = hrd->dpb_output_delay_du_length_minus1 + 1;
- u(length, pic_dpb_output_du_delay, 0, MAX_UINT_BITS(length));
+ ub(length, pic_dpb_output_du_delay);
}
if (hrd->sub_pic_hrd_params_present_flag &&
@@ -1738,16 +1724,14 @@ static int FUNC(sei_pic_timing)(CodedBitstreamContext *ctx, RWContext *rw,
length = hrd->du_cpb_removal_delay_increment_length_minus1 + 1;
if (current->du_common_cpb_removal_delay_flag)
- u(length, du_common_cpb_removal_delay_increment_minus1,
- 0, MAX_UINT_BITS(length));
+ ub(length, du_common_cpb_removal_delay_increment_minus1);
for (i = 0; i <= current->num_decoding_units_minus1; i++) {
ues(num_nalus_in_du_minus1[i],
0, HEVC_MAX_SLICE_SEGMENTS, 1, i);
if (!current->du_common_cpb_removal_delay_flag &&
i < current->num_decoding_units_minus1)
- us(length, du_cpb_removal_delay_increment_minus1[i],
- 0, MAX_UINT_BITS(length), 1, i);
+ ubs(length, du_cpb_removal_delay_increment_minus1[i], 1, i);
}
}
}
@@ -1871,7 +1855,7 @@ static int FUNC(sei_display_orientation)(CodedBitstreamContext *ctx, RWContext *
if (!current->display_orientation_cancel_flag) {
flag(hor_flip);
flag(ver_flip);
- u(16, anticlockwise_rotation, 0, 65535);
+ ub(16, anticlockwise_rotation);
flag(display_orientation_persistence_flag);
}
@@ -1964,7 +1948,7 @@ static int FUNC(sei_time_code)(CodedBitstreamContext *ctx, RWContext *rw,
flags(discontinuity_flag[i], 1, i);
flags(cnt_dropped_flag[i], 1, i);
- us(9, n_frames[i], 0, MAX_UINT_BITS(9), 1, i);
+ ubs(9, n_frames[i], 1, i);
if (current->full_timestamp_flag[i]) {
us(6, seconds_value[i], 0, 59, 1, i);
@@ -1984,11 +1968,9 @@ static int FUNC(sei_time_code)(CodedBitstreamContext *ctx, RWContext *rw,
}
}
- us(5, time_offset_length[i], 0, 31, 1, i);
+ ubs(5, time_offset_length[i], 1, i);
if (current->time_offset_length[i] > 0)
- is(current->time_offset_length[i], time_offset_value[i],
- MIN_INT_BITS(current->time_offset_length[i]),
- MAX_INT_BITS(current->time_offset_length[i]), 1, i);
+ ibs(current->time_offset_length[i], time_offset_value[i], 1, i);
else
infer(time_offset_value[i], 0);
}
@@ -2027,8 +2009,8 @@ static int FUNC(sei_content_light_level)(CodedBitstreamContext *ctx, RWContext *
HEADER("Content Light Level");
- u(16, max_content_light_level, 0, MAX_UINT_BITS(16));
- u(16, max_pic_average_light_level, 0, MAX_UINT_BITS(16));
+ ub(16, max_content_light_level);
+ ub(16, max_pic_average_light_level);
return 0;
}
@@ -2041,7 +2023,7 @@ static int FUNC(sei_alternative_transfer_characteristics)(CodedBitstreamContext
HEADER("Alternative Transfer Characteristics");
- u(8, preferred_transfer_characteristics, 0, 255);
+ ub(8, preferred_transfer_characteristics);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_jpeg.c b/chromium/third_party/ffmpeg/libavcodec/cbs_jpeg.c
index 5a72f0e2e74..83857bbba2d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_jpeg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_jpeg.c
@@ -75,7 +75,7 @@
#include "cbs_jpeg_syntax_template.c"
-#undef READ
+#undef WRITE
#undef READWRITE
#undef RWContext
#undef FUNC
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.c b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.c
index 8b8b2665631..cb202f835bb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.c
@@ -41,20 +41,35 @@
#define SUBSCRIPTS(subs, ...) (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
#define ui(width, name) \
- xui(width, name, current->name, 0)
+ xui(width, name, current->name, 0, MAX_UINT_BITS(width), 0)
+#define uir(width, name) \
+ xui(width, name, current->name, 1, MAX_UINT_BITS(width), 0)
#define uis(width, name, subs, ...) \
- xui(width, name, current->name, subs, __VA_ARGS__)
+ xui(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
+#define uirs(width, name, subs, ...) \
+ xui(width, name, current->name, 1, MAX_UINT_BITS(width), subs, __VA_ARGS__)
+#define sis(width, name, subs, ...) \
+ xsi(width, name, current->name, subs, __VA_ARGS__)
#define READ
#define READWRITE read
#define RWContext GetBitContext
-#define xui(width, name, var, subs, ...) do { \
+#define xui(width, name, var, range_min, range_max, subs, ...) do { \
uint32_t value = 0; \
CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
- &value, 0, (1 << width) - 1)); \
+ &value, range_min, range_max)); \
+ var = value; \
+ } while (0)
+
+#define xsi(width, name, var, subs, ...) do { \
+ int32_t value; \
+ CHECK(ff_cbs_read_signed(ctx, rw, width, #name, \
+ SUBSCRIPTS(subs, __VA_ARGS__), &value, \
+ MIN_INT_BITS(width), \
+ MAX_INT_BITS(width))); \
var = value; \
} while (0)
@@ -73,6 +88,7 @@
#undef READWRITE
#undef RWContext
#undef xui
+#undef xsi
#undef marker_bit
#undef nextbits
@@ -81,10 +97,17 @@
#define READWRITE write
#define RWContext PutBitContext
-#define xui(width, name, var, subs, ...) do { \
+#define xui(width, name, var, range_min, range_max, subs, ...) do { \
CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
- var, 0, (1 << width) - 1)); \
+ var, range_min, range_max)); \
+ } while (0)
+
+#define xsi(width, name, var, subs, ...) do { \
+ CHECK(ff_cbs_write_signed(ctx, rw, width, #name, \
+ SUBSCRIPTS(subs, __VA_ARGS__), var, \
+ MIN_INT_BITS(width), \
+ MAX_INT_BITS(width))); \
} while (0)
#define marker_bit() do { \
@@ -95,10 +118,11 @@
#include "cbs_mpeg2_syntax_template.c"
-#undef READ
+#undef WRITE
#undef READWRITE
#undef RWContext
#undef xui
+#undef xsi
#undef marker_bit
#undef nextbits
@@ -215,18 +239,19 @@ static int cbs_mpeg2_read_unit(CodedBitstreamContext *ctx,
return err; \
} \
break;
- START(0x00, MPEG2RawPictureHeader, picture_header, NULL);
- START(0xb2, MPEG2RawUserData, user_data,
- &cbs_mpeg2_free_user_data);
- START(0xb3, MPEG2RawSequenceHeader, sequence_header, NULL);
- START(0xb5, MPEG2RawExtensionData, extension_data, NULL);
- START(0xb8, MPEG2RawGroupOfPicturesHeader,
- group_of_pictures_header, NULL);
+ START(MPEG2_START_PICTURE, MPEG2RawPictureHeader,
+ picture_header, NULL);
+ START(MPEG2_START_USER_DATA, MPEG2RawUserData,
+ user_data, &cbs_mpeg2_free_user_data);
+ START(MPEG2_START_SEQUENCE_HEADER, MPEG2RawSequenceHeader,
+ sequence_header, NULL);
+ START(MPEG2_START_EXTENSION, MPEG2RawExtensionData,
+ extension_data, NULL);
+ START(MPEG2_START_GROUP, MPEG2RawGroupOfPicturesHeader,
+ group_of_pictures_header, NULL);
#undef START
default:
- av_log(ctx->log_ctx, AV_LOG_ERROR, "Unknown start code %02"PRIx32".\n",
- unit->type);
- return AVERROR_INVALIDDATA;
+ return AVERROR(ENOSYS);
}
}
@@ -244,11 +269,12 @@ static int cbs_mpeg2_write_header(CodedBitstreamContext *ctx,
case start_code: \
err = cbs_mpeg2_write_ ## func(ctx, pbc, unit->content); \
break;
- START(0x00, MPEG2RawPictureHeader, picture_header);
- START(0xb2, MPEG2RawUserData, user_data);
- START(0xb3, MPEG2RawSequenceHeader, sequence_header);
- START(0xb5, MPEG2RawExtensionData, extension_data);
- START(0xb8, MPEG2RawGroupOfPicturesHeader, group_of_pictures_header);
+ START(MPEG2_START_PICTURE, MPEG2RawPictureHeader, picture_header);
+ START(MPEG2_START_USER_DATA, MPEG2RawUserData, user_data);
+ START(MPEG2_START_SEQUENCE_HEADER, MPEG2RawSequenceHeader, sequence_header);
+ START(MPEG2_START_EXTENSION, MPEG2RawExtensionData, extension_data);
+ START(MPEG2_START_GROUP, MPEG2RawGroupOfPicturesHeader,
+ group_of_pictures_header);
#undef START
default:
av_log(ctx->log_ctx, AV_LOG_ERROR, "Write unimplemented for start "
@@ -331,7 +357,7 @@ static int cbs_mpeg2_write_unit(CodedBitstreamContext *ctx,
init_put_bits(&pbc, priv->write_buffer, priv->write_buffer_size);
- if (unit->type >= 0x01 && unit->type <= 0xaf)
+ if (MPEG2_START_IS_SLICE(unit->type))
err = cbs_mpeg2_write_slice(ctx, unit, &pbc);
else
err = cbs_mpeg2_write_header(ctx, unit, &pbc);
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.h b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.h
index 92caa99dc1d..11f93b9df8f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.h
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2.h
@@ -51,7 +51,7 @@ enum {
MPEG2_EXTENSION_PICTURE_CODING = 0x8,
MPEG2_EXTENSION_PICTURE_SPATIAL_SCALABLE = 0x9,
MPEG2_EXTENSION_PICTURE_TEMPORAL_SCALABLE = 0xa,
- MPEG2_EXTENSION_CAMAERA_PARAMETERS = 0xb,
+ MPEG2_EXTENSION_CAMERA_PARAMETERS = 0xb,
MPEG2_EXTENSION_ITU_T = 0xc,
};
@@ -164,8 +164,8 @@ typedef struct MPEG2RawQuantMatrixExtension {
} MPEG2RawQuantMatrixExtension;
typedef struct MPEG2RawPictureDisplayExtension {
- uint16_t frame_centre_horizontal_offset[3];
- uint16_t frame_centre_vertical_offset[3];
+ int16_t frame_centre_horizontal_offset[3];
+ int16_t frame_centre_vertical_offset[3];
} MPEG2RawPictureDisplayExtension;
typedef struct MPEG2RawExtensionData {
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2_syntax_template.c b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2_syntax_template.c
index 88cf453b17f..e0cf7168747 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2_syntax_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_mpeg2_syntax_template.c
@@ -26,14 +26,14 @@ static int FUNC(sequence_header)(CodedBitstreamContext *ctx, RWContext *rw,
ui(8, sequence_header_code);
- ui(12, horizontal_size_value);
- ui(12, vertical_size_value);
+ uir(12, horizontal_size_value);
+ uir(12, vertical_size_value);
mpeg2->horizontal_size = current->horizontal_size_value;
mpeg2->vertical_size = current->vertical_size_value;
- ui(4, aspect_ratio_information);
- ui(4, frame_rate_code);
+ uir(4, aspect_ratio_information);
+ uir(4, frame_rate_code);
ui(18, bit_rate_value);
marker_bit();
@@ -44,13 +44,13 @@ static int FUNC(sequence_header)(CodedBitstreamContext *ctx, RWContext *rw,
ui(1, load_intra_quantiser_matrix);
if (current->load_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, intra_quantiser_matrix[i], 1, i);
+ uirs(8, intra_quantiser_matrix[i], 1, i);
}
ui(1, load_non_intra_quantiser_matrix);
if (current->load_non_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, non_intra_quantiser_matrix[i], 1, i);
+ uirs(8, non_intra_quantiser_matrix[i], 1, i);
}
return 0;
@@ -79,7 +79,7 @@ static int FUNC(user_data)(CodedBitstreamContext *ctx, RWContext *rw,
#endif
for (k = 0; k < current->user_data_length; k++)
- xui(8, user_data, current->user_data[k], 0);
+ uis(8, user_data[k], 1, k);
return 0;
}
@@ -125,9 +125,25 @@ static int FUNC(sequence_display_extension)(CodedBitstreamContext *ctx, RWContex
ui(1, colour_description);
if (current->colour_description) {
- ui(8, colour_primaries);
- ui(8, transfer_characteristics);
- ui(8, matrix_coefficients);
+#ifdef READ
+#define READ_AND_PATCH(name) do { \
+ ui(8, name); \
+ if (current->name == 0) { \
+ current->name = 2; \
+ av_log(ctx->log_ctx, AV_LOG_WARNING, "%s in a sequence display " \
+ "extension had the invalid value 0. Setting it to 2 " \
+ "(meaning unknown) instead.\n", #name); \
+ } \
+ } while (0)
+ READ_AND_PATCH(colour_primaries);
+ READ_AND_PATCH(transfer_characteristics);
+ READ_AND_PATCH(matrix_coefficients);
+#undef READ_AND_PATCH
+#else
+ uir(8, colour_primaries);
+ uir(8, transfer_characteristics);
+ uir(8, matrix_coefficients);
+#endif
}
ui(14, display_horizontal_size);
@@ -163,7 +179,7 @@ static int FUNC(picture_header)(CodedBitstreamContext *ctx, RWContext *rw,
ui(8, picture_start_code);
ui(10, temporal_reference);
- ui(3, picture_coding_type);
+ uir(3, picture_coding_type);
ui(16, vbv_delay);
if (current->picture_coding_type == 2 ||
@@ -190,10 +206,10 @@ static int FUNC(picture_coding_extension)(CodedBitstreamContext *ctx, RWContext
HEADER("Picture Coding Extension");
- ui(4, f_code[0][0]);
- ui(4, f_code[0][1]);
- ui(4, f_code[1][0]);
- ui(4, f_code[1][1]);
+ uir(4, f_code[0][0]);
+ uir(4, f_code[0][1]);
+ uir(4, f_code[1][0]);
+ uir(4, f_code[1][1]);
ui(2, intra_dc_precision);
ui(2, picture_structure);
@@ -250,25 +266,25 @@ static int FUNC(quant_matrix_extension)(CodedBitstreamContext *ctx, RWContext *r
ui(1, load_intra_quantiser_matrix);
if (current->load_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, intra_quantiser_matrix[i], 1, i);
+ uirs(8, intra_quantiser_matrix[i], 1, i);
}
ui(1, load_non_intra_quantiser_matrix);
if (current->load_non_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, non_intra_quantiser_matrix[i], 1, i);
+ uirs(8, non_intra_quantiser_matrix[i], 1, i);
}
ui(1, load_chroma_intra_quantiser_matrix);
if (current->load_chroma_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, intra_quantiser_matrix[i], 1, i);
+ uirs(8, intra_quantiser_matrix[i], 1, i);
}
ui(1, load_chroma_non_intra_quantiser_matrix);
if (current->load_chroma_non_intra_quantiser_matrix) {
for (i = 0; i < 64; i++)
- uis(8, chroma_non_intra_quantiser_matrix[i], 1, i);
+ uirs(8, chroma_non_intra_quantiser_matrix[i], 1, i);
}
return 0;
@@ -283,9 +299,9 @@ static int FUNC(picture_display_extension)(CodedBitstreamContext *ctx, RWContext
HEADER("Picture Display Extension");
for (i = 0; i < mpeg2->number_of_frame_centre_offsets; i++) {
- ui(16, frame_centre_horizontal_offset[i]);
+ sis(16, frame_centre_horizontal_offset[i], 1, i);
marker_bit();
- ui(16, frame_centre_vertical_offset[i]);
+ sis(16, frame_centre_vertical_offset[i], 1, i);
marker_bit();
}
@@ -303,25 +319,25 @@ static int FUNC(extension_data)(CodedBitstreamContext *ctx, RWContext *rw,
ui(4, extension_start_code_identifier);
switch (current->extension_start_code_identifier) {
- case 1:
+ case MPEG2_EXTENSION_SEQUENCE:
return FUNC(sequence_extension)
(ctx, rw, &current->data.sequence);
- case 2:
+ case MPEG2_EXTENSION_SEQUENCE_DISPLAY:
return FUNC(sequence_display_extension)
(ctx, rw, &current->data.sequence_display);
- case 3:
+ case MPEG2_EXTENSION_QUANT_MATRIX:
return FUNC(quant_matrix_extension)
(ctx, rw, &current->data.quant_matrix);
- case 7:
+ case MPEG2_EXTENSION_PICTURE_DISPLAY:
return FUNC(picture_display_extension)
(ctx, rw, &current->data.picture_display);
- case 8:
+ case MPEG2_EXTENSION_PICTURE_CODING:
return FUNC(picture_coding_extension)
(ctx, rw, &current->data.picture_coding);
default:
- av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid extension ID %d.\n",
+ av_log(ctx->log_ctx, AV_LOG_ERROR, "Extension ID %d not supported.\n",
current->extension_start_code_identifier);
- return AVERROR_INVALIDDATA;
+ return AVERROR_PATCHWELCOME;
}
}
@@ -342,7 +358,7 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
ui(7, priority_breakpoint);
}
- ui(5, quantiser_scale_code);
+ uir(5, quantiser_scale_code);
if (nextbits(1, 1, current->slice_extension_flag)) {
ui(1, slice_extension_flag);
@@ -361,21 +377,22 @@ static int FUNC(slice_header)(CodedBitstreamContext *ctx, RWContext *rw,
current->extra_information_length = k;
if (k > 0) {
*rw = start;
- current->extra_information =
- av_malloc(current->extra_information_length);
- if (!current->extra_information)
+ current->extra_information_ref =
+ av_buffer_alloc(current->extra_information_length);
+ if (!current->extra_information_ref)
return AVERROR(ENOMEM);
+ current->extra_information = current->extra_information_ref->data;
for (k = 0; k < current->extra_information_length; k++) {
- xui(1, extra_bit_slice, bit, 0);
+ xui(1, extra_bit_slice, bit, 1, 1, 0);
xui(8, extra_information_slice[k],
- current->extra_information[k], 1, k);
+ current->extra_information[k], 0, 255, 1, k);
}
}
#else
for (k = 0; k < current->extra_information_length; k++) {
- xui(1, extra_bit_slice, 1, 0);
+ xui(1, extra_bit_slice, 1, 1, 1, 0);
xui(8, extra_information_slice[k],
- current->extra_information[k], 1, k);
+ current->extra_information[k], 0, 255, 1, k);
}
#endif
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_vp9.c b/chromium/third_party/ffmpeg/libavcodec/cbs_vp9.c
index 0b5f137ed86..5579d9b0af0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_vp9.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_vp9.c
@@ -395,7 +395,7 @@ static int cbs_vp9_write_le(CodedBitstreamContext *ctx, PutBitContext *pbc,
#include "cbs_vp9_syntax_template.c"
-#undef READ
+#undef WRITE
#undef READWRITE
#undef RWContext
#undef xf
diff --git a/chromium/third_party/ffmpeg/libavcodec/cbs_vp9_syntax_template.c b/chromium/third_party/ffmpeg/libavcodec/cbs_vp9_syntax_template.c
index 898cede329c..125eb025895 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cbs_vp9_syntax_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cbs_vp9_syntax_template.c
@@ -206,8 +206,8 @@ static int FUNC(quantization_params)(CodedBitstreamContext *ctx, RWContext *rw,
static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
VP9RawFrameHeader *current)
{
- static const int segmentation_feature_bits[VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
- static const int segmentation_feature_signed[VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
+ static const uint8_t segmentation_feature_bits[VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
+ static const uint8_t segmentation_feature_signed[VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
int err, i, j;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cfhd.c b/chromium/third_party/ffmpeg/libavcodec/cfhd.c
index 846d334b9b7..49a5a2c30a9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cfhd.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cfhd.c
@@ -884,6 +884,8 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
high = s->plane[plane].l_h[7];
for (i = 0; i < lowpass_height * 2; i++) {
horiz_filter_clip(dst, low, high, lowpass_width, s->bpc);
+ if (avctx->pix_fmt == AV_PIX_FMT_GBRAP12 && act_plane == 3)
+ process_alpha(dst, lowpass_width * 2);
low += lowpass_width;
high += lowpass_width;
dst += pic->linesize[act_plane] / 2;
diff --git a/chromium/third_party/ffmpeg/libavcodec/cinepak.c b/chromium/third_party/ffmpeg/libavcodec/cinepak.c
index 9b0077402f0..aeb15de0ed9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cinepak.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cinepak.c
@@ -323,6 +323,9 @@ static int cinepak_predecode_check (CinepakContext *s)
num_strips = AV_RB16 (&s->data[8]);
encoded_buf_size = AV_RB24(&s->data[1]);
+ if (s->size < encoded_buf_size * (int64_t)(100 - s->avctx->discard_damaged_percentage) / 100)
+ return AVERROR_INVALIDDATA;
+
/* if this is the first frame, check for deviant Sega FILM data */
if (s->sega_film_skip_bytes == -1) {
if (!encoded_buf_size) {
@@ -353,6 +356,13 @@ static int cinepak_predecode_check (CinepakContext *s)
if (s->size < 10 + s->sega_film_skip_bytes + num_strips * 12)
return AVERROR_INVALIDDATA;
+ if (num_strips) {
+ const uint8_t *data = s->data + 10 + s->sega_film_skip_bytes;
+ int strip_size = AV_RB24 (data + 1);
+ if (strip_size < 12 || strip_size > encoded_buf_size)
+ return AVERROR_INVALIDDATA;
+ }
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/cngdec.c b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
index 28432ac7194..43b96fea1bb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cngdec.c
@@ -69,7 +69,6 @@ static av_cold int cng_decode_init(AVCodecContext *avctx)
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);
return AVERROR(ENOMEM);
}
@@ -175,4 +174,6 @@ AVCodec ff_comfortnoise_decoder = {
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
+ FF_CODEC_CAP_INIT_CLEANUP,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
index 621b16e1602..4d033c20ff5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/codec_desc.c
@@ -1719,6 +1719,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("LEAD Screen Capture"),
.props = AV_CODEC_PROP_LOSSY,
},
+ {
+ .id = AV_CODEC_ID_VP4,
+ .type = AVMEDIA_TYPE_VIDEO,
+ .name = "vp4",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP4"),
+ .props = AV_CODEC_PROP_LOSSY,
+ },
/* various PCM "codecs" */
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/cpia.c b/chromium/third_party/ffmpeg/libavcodec/cpia.c
index 58833b2f267..f6d7332606f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cpia.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cpia.c
@@ -63,7 +63,7 @@ static int cpia_decode_frame(AVCodecContext *avctx,
uint8_t *y, *u, *v, *y_end, *u_end, *v_end;
// Check header
- if ( avpkt->size < FRAME_HEADER_SIZE
+ if ( avpkt->size < FRAME_HEADER_SIZE + avctx->height * 3
|| header[0] != MAGIC_0 || header[1] != MAGIC_1
|| (header[17] != SUBSAMPLE_420 && header[17] != SUBSAMPLE_422)
|| (header[18] != YUVORDER_YUYV && header[18] != YUVORDER_UYVY)
diff --git a/chromium/third_party/ffmpeg/libavcodec/cuviddec.c b/chromium/third_party/ffmpeg/libavcodec/cuviddec.c
index 2aecb45768c..acee78cf2cb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/cuviddec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/cuviddec.c
@@ -77,6 +77,7 @@ typedef struct CuvidContext
int deint_mode;
int deint_mode_current;
int64_t prev_pts;
+ int progressive_sequence;
int internal_error;
int decoder_flushing;
@@ -216,6 +217,8 @@ static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* form
? cudaVideoDeinterlaceMode_Weave
: ctx->deint_mode;
+ ctx->progressive_sequence = format->progressive_sequence;
+
if (!format->progressive_sequence && ctx->deint_mode_current == cudaVideoDeinterlaceMode_Weave)
avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT;
else
@@ -349,6 +352,9 @@ static int CUDAAPI cuvid_handle_picture_display(void *opaque, CUVIDPARSERDISPINF
parsed_frame.dispinfo = *dispinfo;
ctx->internal_error = 0;
+ // For some reason, dispinfo->progressive_frame is sometimes wrong.
+ parsed_frame.dispinfo.progressive_frame = ctx->progressive_sequence;
+
if (ctx->deint_mode_current == cudaVideoDeinterlaceMode_Weave) {
av_fifo_generic_write(ctx->frame_queue, &parsed_frame, sizeof(CuvidParsedFrame), NULL);
} else {
@@ -799,6 +805,12 @@ static int cuvid_test_capabilities(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
+ if ((probed_width * probed_height) / 256 > caps->nMaxMBCount) {
+ av_log(avctx, AV_LOG_ERROR, "Video macroblock count %d exceeds maximum of %d\n",
+ (int)(probed_width * probed_height) / 256, caps->nMaxMBCount);
+ return AVERROR(EINVAL);
+ }
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/diracdec.c b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
index a5bb6d5f344..7b9e0099dfc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/diracdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/diracdec.c
@@ -1433,8 +1433,8 @@ static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref)
int *c = s->globalmc[ref].perspective;
int64_t m = (1<<ep) - (c[0]*(int64_t)x + c[1]*(int64_t)y);
- int64_t mx = m * (int64_t)((A[0][0] * (int64_t)x + A[0][1]*(int64_t)y) + (1<<ez) * b[0]);
- int64_t my = m * (int64_t)((A[1][0] * (int64_t)x + A[1][1]*(int64_t)y) + (1<<ez) * b[1]);
+ int64_t mx = m * (int64_t)((A[0][0] * (int64_t)x + A[0][1]*(int64_t)y) + (1LL<<ez) * b[0]);
+ int64_t my = m * (int64_t)((A[1][0] * (int64_t)x + A[1][1]*(int64_t)y) + (1LL<<ez) * b[1]);
block->u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep);
block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep);
@@ -1551,6 +1551,11 @@ static int dirac_unpack_block_motion_data(DiracContext *s)
}
}
+ for (i = 0; i < 4 + 2*s->num_refs; i++) {
+ if (arith[i].error)
+ return arith[i].error;
+ }
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c b/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
index 37175d67b2e..d422df068df 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dsicinvideo.c
@@ -266,8 +266,11 @@ static int cinvideo_decode_frame(AVCodecContext *avctx,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
break;
case 37:
- cin_decode_huffman(buf, bitmap_frame_size,
+ res = cin_decode_huffman(buf, bitmap_frame_size,
cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_size);
+
+ if (cin->bitmap_size - avctx->discard_damaged_percentage*cin->bitmap_size/100 > res)
+ return AVERROR_INVALIDDATA;
break;
case 38:
res = cin_decode_lzss(buf, bitmap_frame_size,
diff --git a/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
index 188a1c619bc..7112cd6bd48 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dump_extradata_bsf.c
@@ -81,7 +81,7 @@ fail:
#define OFFSET(x) offsetof(DumpExtradataContext, x)
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
static const AVOption options[] = {
- { "freq", "When do dump extradata", OFFSET(freq), AV_OPT_TYPE_INT,
+ { "freq", "When to dump extradata", OFFSET(freq), AV_OPT_TYPE_INT,
{ .i64 = DUMP_FREQ_KEYFRAME }, DUMP_FREQ_KEYFRAME, DUMP_FREQ_ALL, FLAGS, "freq" },
{ "k", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME }, .flags = FLAGS, .unit = "freq" },
{ "keyframe", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = DUMP_FREQ_KEYFRAME }, .flags = FLAGS, .unit = "freq" },
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxtory.c b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
index 7024b315d1c..4dd675316b8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxtory.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxtory.c
@@ -286,8 +286,14 @@ static int dxtory_decode_v2(AVCodecContext *avctx, AVFrame *pic,
off_check = off;
gb_check = gb;
- for (slice = 0; slice < nslices; slice++)
- off_check += bytestream2_get_le32(&gb_check);
+ for (slice = 0; slice < nslices; slice++) {
+ slice_size = bytestream2_get_le32(&gb_check);
+
+ if (slice_size <= 16 + (avctx->height * avctx->width / (8 * nslices)))
+ return AVERROR_INVALIDDATA;
+ off_check += slice_size;
+ }
+
if (off_check - avctx->discard_damaged_percentage*off_check/100 > src_size)
return AVERROR_INVALIDDATA;
diff --git a/chromium/third_party/ffmpeg/libavcodec/dxv.c b/chromium/third_party/ffmpeg/libavcodec/dxv.c
index 6fe5516505a..ae79de981f7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/dxv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/dxv.c
@@ -745,6 +745,9 @@ static int dxv_decompress_cocg(DXVContext *ctx, GetByteContext *gb,
int skip0, skip1, oi0 = 0, oi1 = 0;
int ret, state0 = 0, state1 = 0;
+ if (op_offset < 12)
+ return AVERROR_INVALIDDATA;
+
dst = tex_data;
bytestream2_skip(gb, op_offset - 12);
if (op_size0 > max_op_size0)
@@ -1054,6 +1057,10 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
avctx->pix_fmt = AV_PIX_FMT_RGBA;
avctx->colorspace = AVCOL_SPC_RGB;
+ ctx->tex_funct = NULL;
+ ctx->tex_funct_planar[0] = NULL;
+ ctx->tex_funct_planar[1] = NULL;
+
tag = bytestream2_get_le32(gbc);
switch (tag) {
case MKBETAG('D', 'X', 'T', '1'):
diff --git a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
index 35d0c609e5a..ca2287198be 100644
--- a/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
+++ b/chromium/third_party/ffmpeg/libavcodec/error_resilience.c
@@ -1121,6 +1121,8 @@ void ff_er_frame_end(ERContext *s)
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));
+ s->cur_pic.f->decode_error_flags |= FF_DECODE_ERROR_CONCEALMENT_ACTIVE;
+
is_intra_likely = is_intra_more_likely(s);
/* set unknown mb-type to most likely */
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffv1dec_template.c b/chromium/third_party/ffmpeg/libavcodec/ffv1dec_template.c
index 1b7f6c4bf56..0b1d176ba12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffv1dec_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffv1dec_template.c
@@ -86,11 +86,19 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
run_mode = 2;
}
}
+ if (sample[1][x - 1] == sample[0][x - 1]) {
+ while (run_count > 1 && w-x > 1) {
+ sample[1][x] = sample[0][x];
+ x++;
+ run_count--;
+ }
+ } else {
while (run_count > 1 && w-x > 1) {
sample[1][x] = RENAME(predict)(sample[1] + x, sample[0] + x);
x++;
run_count--;
}
+ }
run_count--;
if (run_count < 0) {
run_mode = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
index 9d055e40195..793eada7a58 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ffwavesynth.c
@@ -113,18 +113,12 @@ static uint32_t lcg_next(uint32_t *s)
return *s;
}
-static void lcg_seek(uint32_t *s, int64_t dt)
+static void lcg_seek(uint32_t *s, uint32_t dt)
{
uint32_t a, c, t = *s;
- if (dt >= 0) {
- a = LCG_A;
- c = LCG_C;
- } else { /* coefficients for a step backward */
- a = LCG_AI;
- c = (uint32_t)(LCG_AI * LCG_C);
- dt = -dt;
- }
+ a = LCG_A;
+ c = LCG_C;
while (dt) {
if (dt & 1)
t = a * t + c;
@@ -221,7 +215,7 @@ static void wavesynth_seek(struct wavesynth_context *ws, int64_t ts)
ws->next_inter = i;
ws->next_ts = i < ws->nb_inter ? ws->inter[i].ts_start : INF_TS;
*last = -1;
- lcg_seek(&ws->dither_state, ts - ws->cur_ts);
+ lcg_seek(&ws->dither_state, (uint32_t)ts - ws->cur_ts);
if (ws->pink_need) {
int64_t pink_ts_cur = (ws->cur_ts + PINK_UNIT - 1) & ~(PINK_UNIT - 1);
int64_t pink_ts_next = ts & ~(PINK_UNIT - 1);
@@ -267,7 +261,10 @@ static int wavesynth_parse_extradata(AVCodecContext *avc)
in->type = AV_RL32(edata + 16);
in->channels = AV_RL32(edata + 20);
edata += 24;
- if (in->ts_start < cur_ts || in->ts_end <= in->ts_start)
+ if (in->ts_start < cur_ts ||
+ in->ts_end <= in->ts_start ||
+ (uint64_t)in->ts_end - in->ts_start > INT64_MAX
+ )
return AVERROR(EINVAL);
cur_ts = in->ts_start;
dt = in->ts_end - in->ts_start;
diff --git a/chromium/third_party/ffmpeg/libavcodec/fic.c b/chromium/third_party/ffmpeg/libavcodec/fic.c
index 65d102b86be..540078eda12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fic.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fic.c
@@ -356,7 +356,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
- if (msize <= 0) {
+ if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
return AVERROR_INVALIDDATA;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/filter_units_bsf.c b/chromium/third_party/ffmpeg/libavcodec/filter_units_bsf.c
index bc2ca288dd9..380f23e5a75 100644
--- a/chromium/third_party/ffmpeg/libavcodec/filter_units_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/filter_units_bsf.c
@@ -98,63 +98,51 @@ invalid:
return AVERROR(EINVAL);
}
-static int filter_units_filter(AVBSFContext *bsf, AVPacket *out)
+static int filter_units_filter(AVBSFContext *bsf, AVPacket *pkt)
{
FilterUnitsContext *ctx = bsf->priv_data;
CodedBitstreamFragment *frag = &ctx->fragment;
- AVPacket *in = NULL;
int err, i, j;
- while (1) {
- err = ff_bsf_get_packet(bsf, &in);
- if (err < 0)
- return err;
+ err = ff_bsf_get_packet_ref(bsf, pkt);
+ if (err < 0)
+ return err;
- if (ctx->mode == NOOP) {
- av_packet_move_ref(out, in);
- av_packet_free(&in);
- return 0;
- }
+ if (ctx->mode == NOOP)
+ return 0;
- err = ff_cbs_read_packet(ctx->cbc, frag, in);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
- goto fail;
- }
+ err = ff_cbs_read_packet(ctx->cbc, frag, pkt);
+ if (err < 0) {
+ av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
+ goto fail;
+ }
- for (i = 0; i < frag->nb_units; i++) {
- for (j = 0; j < ctx->nb_types; j++) {
- if (frag->units[i].type == ctx->type_list[j])
- break;
- }
- if (ctx->mode == REMOVE ? j < ctx->nb_types
- : j >= ctx->nb_types) {
- ff_cbs_delete_unit(ctx->cbc, frag, i);
- --i;
- }
+ for (i = frag->nb_units - 1; i >= 0; i--) {
+ for (j = 0; j < ctx->nb_types; j++) {
+ if (frag->units[i].type == ctx->type_list[j])
+ break;
}
+ if (ctx->mode == REMOVE ? j < ctx->nb_types
+ : j >= ctx->nb_types)
+ ff_cbs_delete_unit(ctx->cbc, frag, i);
+ }
- if (frag->nb_units > 0)
- break;
-
+ if (frag->nb_units == 0) {
// Don't return packets with nothing in them.
- av_packet_free(&in);
- ff_cbs_fragment_reset(ctx->cbc, frag);
+ err = AVERROR(EAGAIN);
+ goto fail;
}
- err = ff_cbs_write_packet(ctx->cbc, out, frag);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, frag);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
fail:
+ if (err < 0)
+ av_packet_unref(pkt);
ff_cbs_fragment_reset(ctx->cbc, frag);
- av_packet_free(&in);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/fits.c b/chromium/third_party/ffmpeg/libavcodec/fits.c
index 365347fc640..ad73ab70de2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fits.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fits.c
@@ -138,6 +138,17 @@ int avpriv_fits_header_parse_line(void *avcl, FITSHeader *header, const uint8_t
case STATE_BITPIX:
CHECK_KEYWORD("BITPIX");
CHECK_VALUE("BITPIX", bitpix);
+
+ switch(header->bitpix) {
+ case 8:
+ case 16:
+ case 32: case -32:
+ case 64: case -64: break;
+ default:
+ av_log(avcl, AV_LOG_ERROR, "invalid value of BITPIX %d\n", header->bitpix); \
+ return AVERROR_INVALIDDATA;
+ }
+
dict_set_if_not_null(metadata, keyword, value);
header->state = STATE_NAXIS;
diff --git a/chromium/third_party/ffmpeg/libavcodec/fitsdec.c b/chromium/third_party/ffmpeg/libavcodec/fitsdec.c
index b0753813c9c..4f452422efd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fitsdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fitsdec.c
@@ -143,7 +143,7 @@ static int fits_read_header(AVCodecContext *avctx, const uint8_t **ptr, FITSHead
size = abs(header->bitpix) >> 3;
for (i = 0; i < header->naxis; i++) {
- if (header->naxisn[i] > SIZE_MAX / size) {
+ if (size && header->naxisn[i] > SIZE_MAX / size) {
av_log(avctx, AV_LOG_ERROR, "unsupported size of FITS image");
return AVERROR_INVALIDDATA;
}
@@ -168,6 +168,14 @@ static int fits_read_header(AVCodecContext *avctx, const uint8_t **ptr, FITSHead
header->data_min = (header->data_min - header->bzero) / header->bscale;
header->data_max = (header->data_max - header->bzero) / header->bscale;
}
+ if (!header->rgb && header->data_min >= header->data_max) {
+ if (header->data_min > header->data_max) {
+ av_log(avctx, AV_LOG_ERROR, "data min/max (%g %g) is invalid\n", header->data_min, header->data_max);
+ return AVERROR_INVALIDDATA;
+ }
+ av_log(avctx, AV_LOG_WARNING, "data min/max indicates a blank image\n");
+ header->data_max ++;
+ }
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/flicvideo.c b/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
index ba5bda48c48..c0e1e16bcdc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/flicvideo.c
@@ -900,7 +900,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx,
} else {
if (bytestream2_tell(&g2) + 2*byte_run > stream_ptr_after_chunk)
break;
- CHECK_PIXEL_PTR(2 * byte_run);
+ CHECK_PIXEL_PTR(3 * byte_run);
for (j = 0; j < byte_run; j++, pixel_countdown--) {
pixel = bytestream2_get_le24(&g2);
AV_WL24(&pixels[pixel_ptr], pixel);
diff --git a/chromium/third_party/ffmpeg/libavcodec/fmvc.c b/chromium/third_party/ffmpeg/libavcodec/fmvc.c
index 5778d7b53f8..5bee96a18de 100644
--- a/chromium/third_party/ffmpeg/libavcodec/fmvc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/fmvc.c
@@ -402,6 +402,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
AVFrame *frame = data;
int ret, y, x;
+ if (avpkt->size < 8)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavcodec/gdv.c b/chromium/third_party/ffmpeg/libavcodec/gdv.c
index 183286b55f1..a5ce6b799e0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gdv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gdv.c
@@ -308,7 +308,7 @@ static int decompress_5(AVCodecContext *avctx, unsigned skip)
int len;
int b = bytestream2_get_byte(gb);
if (b == 0) {
- break;
+ return 0;
}
if (b != 0xFF) {
len = b;
@@ -323,6 +323,8 @@ static int decompress_5(AVCodecContext *avctx, unsigned skip)
lz_copy(pb, g2, off, len);
}
}
+ if (bytestream2_get_bytes_left_p(pb) > 0)
+ return AVERROR_INVALIDDATA;
return 0;
}
@@ -445,6 +447,9 @@ static int decompress_68(AVCodecContext *avctx, unsigned skip, unsigned use8)
}
}
+ if (bytestream2_get_bytes_left_p(pb) > 0)
+ return AVERROR_INVALIDDATA;
+
return 0;
}
@@ -475,6 +480,8 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
if (pal && pal_size == AVPALETTE_SIZE)
memcpy(gdv->pal, pal, AVPALETTE_SIZE);
+ if (compression < 2 && bytestream2_get_bytes_left(gb) < 256*3)
+ return AVERROR_INVALIDDATA;
rescale(gdv, gdv->frame, avctx->width, avctx->height,
!!(flags & 0x10), !!(flags & 0x20));
@@ -482,8 +489,6 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
case 1:
memset(gdv->frame + PREAMBLE_SIZE, 0, gdv->frame_size - PREAMBLE_SIZE);
case 0:
- if (bytestream2_get_bytes_left(gb) < 256*3)
- return AVERROR_INVALIDDATA;
for (i = 0; i < 256; i++) {
unsigned r = bytestream2_get_byte(gb);
unsigned g = bytestream2_get_byte(gb);
diff --git a/chromium/third_party/ffmpeg/libavcodec/gif.c b/chromium/third_party/ffmpeg/libavcodec/gif.c
index 9f2f30d8631..e2242d04389 100644
--- a/chromium/third_party/ffmpeg/libavcodec/gif.c
+++ b/chromium/third_party/ffmpeg/libavcodec/gif.c
@@ -136,7 +136,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
while (*y_start < y_end) {
int is_trans = 1;
for (int i = 0; i < w; i++) {
- if (buf[w * *y_start + i] != trans) {
+ if (buf[linesize * *y_start + i] != trans) {
is_trans = 0;
break;
}
@@ -148,10 +148,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
}
// crop bottom
- while (y_end < h) {
+ while (y_end > *y_start) {
int is_trans = 1;
for (int i = 0; i < w; i++) {
- if (buf[w * y_end + i] != trans) {
+ if (buf[linesize * y_end + i] != trans) {
is_trans = 0;
break;
}
@@ -165,7 +165,7 @@ static void gif_crop_translucent(AVCodecContext *avctx,
while (*x_start < x_end) {
int is_trans = 1;
for (int i = *y_start; i < y_end; i++) {
- if (buf[w * i + *x_start] != trans) {
+ if (buf[linesize * i + *x_start] != trans) {
is_trans = 0;
break;
}
@@ -176,10 +176,10 @@ static void gif_crop_translucent(AVCodecContext *avctx,
}
// crop right
- while (x_end < w) {
+ while (x_end > *x_start) {
int is_trans = 1;
for (int i = *y_start; i < y_end; i++) {
- if (buf[w * i + x_end] != trans) {
+ if (buf[linesize * i + x_end] != trans) {
is_trans = 0;
break;
}
@@ -472,7 +472,7 @@ static const AVOption gif_options[] = {
{ "gifflags", "set GIF flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = GF_OFFSETTING|GF_TRANSDIFF}, 0, INT_MAX, FLAGS, "flags" },
{ "offsetting", "enable picture offsetting", 0, AV_OPT_TYPE_CONST, {.i64=GF_OFFSETTING}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "transdiff", "enable transparency detection between frames", 0, AV_OPT_TYPE_CONST, {.i64=GF_TRANSDIFF}, INT_MIN, INT_MAX, FLAGS, "flags" },
- { "gifimage", "enable encoding only images per frame", OFFSET(image), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS, "flags" },
+ { "gifimage", "enable encoding only images per frame", OFFSET(image), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/golomb.h b/chromium/third_party/ffmpeg/libavcodec/golomb.h
index fcc78f44c14..5cdfa0945d3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/golomb.h
+++ b/chromium/third_party/ffmpeg/libavcodec/golomb.h
@@ -49,6 +49,8 @@ extern const uint8_t ff_interleaved_dirac_golomb_vlc_code[256];
/**
* Read an unsigned Exp-Golomb code in the range 0 to 8190.
+ *
+ * @returns the read value or a negative error code.
*/
static inline int get_ue_golomb(GetBitContext *gb)
{
diff --git a/chromium/third_party/ffmpeg/libavcodec/h263dec.c b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
index 3302a614122..d1735e503ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h263dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h263dec.c
@@ -741,6 +741,19 @@ const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
AV_PIX_FMT_NONE
};
+const AVCodecHWConfigInternal *ff_h263_hw_config_list[] = {
+#if CONFIG_H263_VAAPI_HWACCEL
+ HWACCEL_VAAPI(h263),
+#endif
+#if CONFIG_MPEG4_VDPAU_HWACCEL
+ HWACCEL_VDPAU(mpeg4),
+#endif
+#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL
+ HWACCEL_VIDEOTOOLBOX(h263),
+#endif
+ NULL
+};
+
AVCodec ff_h263_decoder = {
.name = "h263",
.long_name = NULL_IF_CONFIG_SMALL("H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2"),
@@ -756,6 +769,7 @@ AVCodec ff_h263_decoder = {
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
+ .hw_configs = ff_h263_hw_config_list,
};
AVCodec ff_h263p_decoder = {
@@ -773,16 +787,5 @@ AVCodec ff_h263p_decoder = {
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
- .hw_configs = (const AVCodecHWConfigInternal*[]) {
-#if CONFIG_H263_VAAPI_HWACCEL
- HWACCEL_VAAPI(h263),
-#endif
-#if CONFIG_MPEG4_VDPAU_HWACCEL
- HWACCEL_VDPAU(mpeg4),
-#endif
-#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL
- HWACCEL_VIDEOTOOLBOX(h263),
-#endif
- NULL
- },
+ .hw_configs = ff_h263_hw_config_list,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c
index ae54929b853..1c1c340d8f7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_metadata_bsf.c
@@ -283,21 +283,18 @@ static int h264_metadata_update_sps(AVBSFContext *bsf,
return 0;
}
-static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
+static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
{
H264MetadataContext *ctx = bsf->priv_data;
- AVPacket *in = NULL;
CodedBitstreamFragment *au = &ctx->access_unit;
int err, i, j, has_sps;
H264RawAUD aud;
- uint8_t *displaymatrix_side_data = NULL;
- size_t displaymatrix_side_data_size = 0;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->cbc, au, in);
+ err = ff_cbs_read_packet(ctx->cbc, au, pkt);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
goto fail;
@@ -428,16 +425,9 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
if (ctx->delete_filler) {
- for (i = 0; i < au->nb_units; i++) {
+ for (i = au->nb_units - 1; i >= 0; i--) {
if (au->units[i].type == H264_NAL_FILLER_DATA) {
- // Filler NAL units.
- err = ff_cbs_delete_unit(ctx->cbc, au, i);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete "
- "filler NAL.\n");
- goto fail;
- }
- --i;
+ ff_cbs_delete_unit(ctx->cbc, au, i);
continue;
}
@@ -445,34 +435,24 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
// Filler SEI messages.
H264RawSEI *sei = au->units[i].content;
- for (j = 0; j < sei->payload_count; j++) {
+ for (j = sei->payload_count - 1; j >= 0; j--) {
if (sei->payload[j].payload_type ==
- H264_SEI_TYPE_FILLER_PAYLOAD) {
- err = ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete "
- "filler SEI message.\n");
- goto fail;
- }
- // Renumbering might have happened, start again at
- // the same NAL unit position.
- --i;
- break;
- }
+ H264_SEI_TYPE_FILLER_PAYLOAD)
+ ff_cbs_h264_delete_sei_message(ctx->cbc, au,
+ &au->units[i], j);
}
}
}
}
if (ctx->display_orientation != PASS) {
- for (i = 0; i < au->nb_units; i++) {
+ for (i = au->nb_units - 1; i >= 0; i--) {
H264RawSEI *sei;
if (au->units[i].type != H264_NAL_SEI)
continue;
sei = au->units[i].content;
- for (j = 0; j < sei->payload_count; j++) {
+ for (j = sei->payload_count - 1; j >= 0; j--) {
H264RawSEIDisplayOrientation *disp;
int32_t *matrix;
@@ -483,18 +463,12 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
if (ctx->display_orientation == REMOVE ||
ctx->display_orientation == INSERT) {
- err = ff_cbs_h264_delete_sei_message(ctx->cbc, au,
- &au->units[i], j);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to delete "
- "display orientation SEI message.\n");
- goto fail;
- }
- --i;
- break;
+ ff_cbs_h264_delete_sei_message(ctx->cbc, au,
+ &au->units[i], j);
+ continue;
}
- matrix = av_mallocz(9 * sizeof(int32_t));
+ matrix = av_malloc(9 * sizeof(int32_t));
if (!matrix) {
err = AVERROR(ENOMEM);
goto fail;
@@ -506,11 +480,17 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
av_display_matrix_flip(matrix, disp->hor_flip, disp->ver_flip);
// If there are multiple display orientation messages in an
- // access unit then ignore all but the last one.
- av_freep(&displaymatrix_side_data);
-
- displaymatrix_side_data = (uint8_t*)matrix;
- displaymatrix_side_data_size = 9 * sizeof(int32_t);
+ // access unit, then the last one added to the packet (i.e.
+ // the first one in the access unit) will prevail.
+ err = av_packet_add_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX,
+ (uint8_t*)matrix,
+ 9 * sizeof(int32_t));
+ if (err < 0) {
+ av_log(bsf, AV_LOG_ERROR, "Failed to attach extracted "
+ "displaymatrix side data to packet.\n");
+ av_freep(matrix);
+ goto fail;
+ }
}
}
}
@@ -524,7 +504,7 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
int size;
int write = 0;
- data = av_packet_get_side_data(in, AV_PKT_DATA_DISPLAYMATRIX, &size);
+ data = av_packet_get_side_data(pkt, AV_PKT_DATA_DISPLAYMATRIX, &size);
if (data && size >= 9 * sizeof(int32_t)) {
int32_t matrix[9];
int hflip, vflip;
@@ -584,38 +564,20 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
}
- err = ff_cbs_write_packet(ctx->cbc, out, au);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, au);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
- if (displaymatrix_side_data) {
- err = av_packet_add_side_data(out, AV_PKT_DATA_DISPLAYMATRIX,
- displaymatrix_side_data,
- displaymatrix_side_data_size);
- if (err) {
- av_log(bsf, AV_LOG_ERROR, "Failed to attach extracted "
- "displaymatrix side data to packet.\n");
- goto fail;
- }
- displaymatrix_side_data = NULL;
- }
-
ctx->done_first_au = 1;
err = 0;
fail:
ff_cbs_fragment_reset(ctx->cbc, au);
- av_freep(&displaymatrix_side_data);
if (err < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_parse.c b/chromium/third_party/ffmpeg/libavcodec/h264_parse.c
index a075443d173..ac31f54e07e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_parse.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_parse.c
@@ -301,7 +301,8 @@ int ff_h264_init_poc(int pic_field_poc[2], int *pic_poc,
if (picture_structure == PICT_FRAME)
field_poc[1] += pc->delta_poc_bottom;
} else if (sps->poc_type == 1) {
- int abs_frame_num, expected_delta_per_poc_cycle, expectedpoc;
+ int abs_frame_num;
+ int64_t expected_delta_per_poc_cycle, expectedpoc;
int i;
if (sps->poc_cycle_length != 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
index 17bfa780ce2..e8738d85023 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_ps.c
@@ -449,8 +449,17 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
sps->log2_max_poc_lsb = t + 4;
} else if (sps->poc_type == 1) { // FIXME #define
sps->delta_pic_order_always_zero_flag = get_bits1(gb);
- sps->offset_for_non_ref_pic = get_se_golomb(gb);
- sps->offset_for_top_to_bottom_field = get_se_golomb(gb);
+ sps->offset_for_non_ref_pic = get_se_golomb_long(gb);
+ sps->offset_for_top_to_bottom_field = get_se_golomb_long(gb);
+
+ if ( sps->offset_for_non_ref_pic == INT32_MIN
+ || sps->offset_for_top_to_bottom_field == INT32_MIN
+ ) {
+ av_log(avctx, AV_LOG_ERROR,
+ "offset_for_non_ref_pic or offset_for_top_to_bottom_field is out of range\n");
+ goto fail;
+ }
+
sps->poc_cycle_length = get_ue_golomb(gb);
if ((unsigned)sps->poc_cycle_length >=
@@ -460,8 +469,14 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
goto fail;
}
- for (i = 0; i < sps->poc_cycle_length; i++)
- sps->offset_for_ref_frame[i] = get_se_golomb(gb);
+ for (i = 0; i < sps->poc_cycle_length; i++) {
+ sps->offset_for_ref_frame[i] = get_se_golomb_long(gb);
+ if (sps->offset_for_ref_frame[i] == INT32_MIN) {
+ av_log(avctx, AV_LOG_ERROR,
+ "offset_for_ref_frame is out of range\n");
+ goto fail;
+ }
+ }
} else if (sps->poc_type != 2) {
av_log(avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type);
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_ps.h b/chromium/third_party/ffmpeg/libavcodec/h264_ps.h
index e967b9cbcfd..9014326dfb4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_ps.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_ps.h
@@ -81,7 +81,7 @@ typedef struct SPS {
uint32_t num_units_in_tick;
uint32_t time_scale;
int fixed_frame_rate_flag;
- short offset_for_ref_frame[256]; // FIXME dyn aloc?
+ int32_t offset_for_ref_frame[256];
int bitstream_restriction_flag;
int num_reorder_frames;
int scaling_matrix_present;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264_redundant_pps_bsf.c b/chromium/third_party/ffmpeg/libavcodec/h264_redundant_pps_bsf.c
index db8717d69a0..8405738c4b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264_redundant_pps_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264_redundant_pps_bsf.c
@@ -66,19 +66,18 @@ static int h264_redundant_pps_fixup_slice(H264RedundantPPSContext *ctx,
return 0;
}
-static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *out)
+static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *pkt)
{
H264RedundantPPSContext *ctx = bsf->priv_data;
- AVPacket *in;
CodedBitstreamFragment *au = &ctx->access_unit;
int au_has_sps;
int err, i;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->input, au, in);
+ err = ff_cbs_read_packet(ctx->input, au, pkt);
if (err < 0)
goto fail;
@@ -94,10 +93,10 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *out)
goto fail;
if (!au_has_sps) {
av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS "
- "at %"PRId64".\n", in->pts);
- err = ff_cbs_delete_unit(ctx->input, au, i);
- if (err < 0)
- goto fail;
+ "at %"PRId64".\n", pkt->pts);
+ ff_cbs_delete_unit(ctx->input, au, i);
+ i--;
+ continue;
}
}
if (nal->type == H264_NAL_SLICE ||
@@ -107,21 +106,15 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *out)
}
}
- err = ff_cbs_write_packet(ctx->output, out, au);
- if (err < 0)
- goto fail;
-
-
- err = av_packet_copy_props(out, in);
+ err = ff_cbs_write_packet(ctx->output, pkt, au);
if (err < 0)
goto fail;
err = 0;
fail:
ff_cbs_fragment_reset(ctx->output, au);
- av_packet_free(&in);
if (err < 0)
- av_packet_unref(out);
+ av_packet_unref(pkt);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/h264dec.c b/chromium/third_party/ffmpeg/libavcodec/h264dec.c
index 99362749cc8..cb49c62074c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h264dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h264dec.c
@@ -759,6 +759,11 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
goto end;
+ // set decode_error_flags to allow users to detect concealed decoding errors
+ if ((ret < 0 || h->slice_ctx->er.error_occurred) && h->cur_pic_ptr) {
+ h->cur_pic_ptr->f->decode_error_flags |= FF_DECODE_ERROR_DECODE_SLICES;
+ }
+
ret = 0;
end:
diff --git a/chromium/third_party/ffmpeg/libavcodec/h265_metadata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/h265_metadata_bsf.c
index 0683cc2f9d5..b3a1fda144e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h265_metadata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h265_metadata_bsf.c
@@ -23,6 +23,7 @@
#include "cbs.h"
#include "cbs_h265.h"
#include "hevc.h"
+#include "h265_profile_level.h"
enum {
PASS,
@@ -30,6 +31,11 @@ enum {
REMOVE,
};
+enum {
+ LEVEL_UNSET = -2,
+ LEVEL_AUTO = -1,
+};
+
typedef struct H265MetadataContext {
const AVClass *class;
@@ -58,9 +64,105 @@ typedef struct H265MetadataContext {
int crop_right;
int crop_top;
int crop_bottom;
+
+ int level;
+ int level_guess;
+ int level_warned;
} H265MetadataContext;
+static void h265_metadata_guess_level(AVBSFContext *bsf,
+ const CodedBitstreamFragment *au)
+{
+ H265MetadataContext *ctx = bsf->priv_data;
+ const H265LevelDescriptor *desc;
+ const H265RawProfileTierLevel *ptl = NULL;
+ const H265RawHRDParameters *hrd = NULL;
+ int64_t bit_rate = 0;
+ int width = 0, height = 0;
+ int tile_cols = 0, tile_rows = 0;
+ int max_dec_pic_buffering = 0;
+ int i;
+
+ for (i = 0; i < au->nb_units; i++) {
+ const CodedBitstreamUnit *unit = &au->units[i];
+
+ if (unit->type == HEVC_NAL_VPS) {
+ const H265RawVPS *vps = unit->content;
+
+ ptl = &vps->profile_tier_level;
+ max_dec_pic_buffering = vps->vps_max_dec_pic_buffering_minus1[0] + 1;
+
+ if (vps->vps_num_hrd_parameters > 0)
+ hrd = &vps->hrd_parameters[0];
+
+ } else if (unit->type == HEVC_NAL_SPS) {
+ const H265RawSPS *sps = unit->content;
+
+ ptl = &sps->profile_tier_level;
+ max_dec_pic_buffering = sps->sps_max_dec_pic_buffering_minus1[0] + 1;
+
+ width = sps->pic_width_in_luma_samples;
+ height = sps->pic_height_in_luma_samples;
+
+ if (sps->vui.vui_hrd_parameters_present_flag)
+ hrd = &sps->vui.hrd_parameters;
+
+ } else if (unit->type == HEVC_NAL_PPS) {
+ const H265RawPPS *pps = unit->content;
+
+ if (pps->tiles_enabled_flag) {
+ tile_cols = pps->num_tile_columns_minus1 + 1;
+ tile_rows = pps->num_tile_rows_minus1 + 1;
+ }
+ }
+ }
+
+ if (hrd) {
+ if (hrd->nal_hrd_parameters_present_flag) {
+ bit_rate = (hrd->nal_sub_layer_hrd_parameters[0].bit_rate_value_minus1[0] + 1) *
+ (INT64_C(1) << hrd->bit_rate_scale + 6);
+ } else if (hrd->vcl_hrd_parameters_present_flag) {
+ bit_rate = (hrd->vcl_sub_layer_hrd_parameters[0].bit_rate_value_minus1[0] + 1) *
+ (INT64_C(1) << hrd->bit_rate_scale + 6);
+ // Adjust for VCL vs. NAL limits.
+ bit_rate = bit_rate * 11 / 10;
+ }
+ }
+
+ desc = ff_h265_guess_level(ptl, bit_rate, width, height,
+ 0, tile_cols, tile_rows,
+ max_dec_pic_buffering);
+ if (desc) {
+ av_log(bsf, AV_LOG_DEBUG, "Stream appears to conform to "
+ "level %s.\n", desc->name);
+ ctx->level_guess = desc->level_idc;
+ }
+}
+
+static void h265_metadata_update_level(AVBSFContext *bsf,
+ uint8_t *level_idc)
+{
+ H265MetadataContext *ctx = bsf->priv_data;
+
+ if (ctx->level != LEVEL_UNSET) {
+ if (ctx->level == LEVEL_AUTO) {
+ if (ctx->level_guess) {
+ *level_idc = ctx->level_guess;
+ } else {
+ if (!ctx->level_warned) {
+ av_log(bsf, AV_LOG_WARNING, "Unable to determine level "
+ "of stream: using level 8.5.\n");
+ ctx->level_warned = 1;
+ }
+ *level_idc = 255;
+ }
+ } else {
+ *level_idc = ctx->level;
+ }
+ }
+}
+
static int h265_metadata_update_vps(AVBSFContext *bsf,
H265RawVPS *vps)
{
@@ -86,6 +188,8 @@ static int h265_metadata_update_vps(AVBSFContext *bsf,
}
}
+ h265_metadata_update_level(bsf, &vps->profile_tier_level.general_level_idc);
+
return 0;
}
@@ -227,21 +331,22 @@ static int h265_metadata_update_sps(AVBSFContext *bsf,
if (need_vui)
sps->vui_parameters_present_flag = 1;
+ h265_metadata_update_level(bsf, &sps->profile_tier_level.general_level_idc);
+
return 0;
}
-static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *out)
+static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
{
H265MetadataContext *ctx = bsf->priv_data;
- AVPacket *in = NULL;
CodedBitstreamFragment *au = &ctx->access_unit;
int err, i;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->cbc, au, in);
+ err = ff_cbs_read_packet(ctx->cbc, au, pkt);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
goto fail;
@@ -290,13 +395,16 @@ static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *out)
err = ff_cbs_insert_unit_content(ctx->cbc, au,
0, HEVC_NAL_AUD, aud, NULL);
- if (err) {
+ if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to insert AUD.\n");
goto fail;
}
}
}
+ if (ctx->level == LEVEL_AUTO && !ctx->level_guess)
+ h265_metadata_guess_level(bsf, au);
+
for (i = 0; i < au->nb_units; i++) {
if (au->units[i].type == HEVC_NAL_VPS) {
err = h265_metadata_update_vps(bsf, au->units[i].content);
@@ -310,23 +418,18 @@ static int h265_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
}
- err = ff_cbs_write_packet(ctx->cbc, out, au);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, au);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
err = 0;
fail:
ff_cbs_fragment_reset(ctx->cbc, au);
if (err < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return err;
}
@@ -348,6 +451,9 @@ static int h265_metadata_init(AVBSFContext *bsf)
goto fail;
}
+ if (ctx->level == LEVEL_AUTO)
+ h265_metadata_guess_level(bsf, au);
+
for (i = 0; i < au->nb_units; i++) {
if (au->units[i].type == HEVC_NAL_VPS) {
err = h265_metadata_update_vps(bsf, au->units[i].content);
@@ -441,6 +547,30 @@ static const AVOption h265_metadata_options[] = {
OFFSET(crop_bottom), AV_OPT_TYPE_INT,
{ .i64 = -1 }, -1, HEVC_MAX_HEIGHT, FLAGS },
+ { "level", "Set level (tables A.6 and A.7)",
+ OFFSET(level), AV_OPT_TYPE_INT,
+ { .i64 = LEVEL_UNSET }, LEVEL_UNSET, 0xff, FLAGS, "level" },
+ { "auto", "Attempt to guess level from stream properties",
+ 0, AV_OPT_TYPE_CONST,
+ { .i64 = LEVEL_AUTO }, .flags = FLAGS, .unit = "level" },
+#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
+ { .i64 = value }, .flags = FLAGS, .unit = "level"
+ { LEVEL("1", 30) },
+ { LEVEL("2", 60) },
+ { LEVEL("2.1", 63) },
+ { LEVEL("3", 90) },
+ { LEVEL("3.1", 93) },
+ { LEVEL("4", 120) },
+ { LEVEL("4.1", 123) },
+ { LEVEL("5", 150) },
+ { LEVEL("5.1", 153) },
+ { LEVEL("5.2", 156) },
+ { LEVEL("6", 180) },
+ { LEVEL("6.1", 183) },
+ { LEVEL("6.2", 186) },
+ { LEVEL("8.5", 255) },
+#undef LEVEL
+
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.c b/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.c
index 6604ca254d2..70db1a52f6e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.c
+++ b/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.c
@@ -43,76 +43,80 @@ static const H265ProfileDescriptor h265_profiles[] = {
// profile_idc 8bit one-picture
// HT-profile | 422chroma | lower-bit-rate
// | 14bit | | 420chroma | | CpbVclFactor MinCrScaleFactor
- // | | 12bit | | | monochrome| | CpbNalFactor |
+ // | | 12bit | | | monochrome| | CpbNalFactor | maxDpbPicBuf
// | | | 10bit | | | intra | | | FormatCapabilityFactor
- { "Monochrome", // | | | | | | | | | |
- 4, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 667, 733, 1.000, 1.0 },
+ { "Monochrome", // | | | | | | | | | | |
+ 4, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 667, 733, 1.000, 1.0, 6 },
+ { "Monochrome 10",
+ 4, 0, 2, 1, 1, 0, 1, 1, 1, 0, 0, 1, 833, 917, 1.250, 1.0, 6 },
{ "Monochrome 12",
- 4, 0, 2, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1000, 1100, 1.500, 1.0 },
+ 4, 0, 2, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1000, 1100, 1.500, 1.0, 6 },
{ "Monochrome 16",
- 4, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1333, 1467, 2.000, 1.0 },
+ 4, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1333, 1467, 2.000, 1.0, 6 },
{ "Main",
- 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0 },
+ 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0, 6 },
{ "Screen-Extended Main",
- 9, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.500, 1.0 },
+ 9, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.500, 1.0, 7 },
{ "Main 10",
- 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.875, 1.0 },
+ 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 1000, 1100, 1.875, 1.0, 6 },
{ "Screen-Extended Main 10",
- 9, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.875, 1.0 },
+ 9, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1000, 1100, 1.875, 1.0, 7 },
{ "Main 12",
- 4, 0, 2, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1500, 1650, 2.250, 1.0 },
+ 4, 0, 2, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1500, 1650, 2.250, 1.0, 6 },
{ "Main Still Picture",
- 3, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0 },
+ 3, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1000, 1100, 1.500, 1.0, 6 },
+ { "Main 10 Still Picture",
+ 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1000, 1100, 1.875, 1.0, 6 },
{ "Main 4:2:2 10",
- 4, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1667, 1833, 2.500, 0.5 },
+ 4, 0, 2, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1667, 1833, 2.500, 0.5, 6 },
{ "Main 4:2:2 12",
- 4, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 },
+ 4, 0, 2, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5, 6 },
{ "Main 4:4:4",
- 4, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 },
+ 4, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5, 6 },
{ "High Throughput 4:4:4",
- 5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 },
+ 5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5, 6 },
{ "Screen-Extended Main 4:4:4",
- 9, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 },
+ 9, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5, 7 },
{ "Screen-Extended High Throughput 4:4:4",
- 9, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5 },
+ 9, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 2200, 3.000, 0.5, 7 },
{ "Main 4:4:4 10",
- 4, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 },
+ 4, 0, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5, 6 },
{ "High Throughput 4:4:4 10",
- 5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 },
+ 5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5, 6 },
{ "Screen-Extended Main 4:4:4 10",
- 9, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 },
+ 9, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5, 7 },
{ "Screen-Extended High Throughput 4:4:4 10",
- 9, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5 },
+ 9, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 2500, 2750, 3.750, 0.5, 7 },
{ "Main 4:4:4 12",
- 4, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3000, 3300, 4.500, 0.5 },
+ 4, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3000, 3300, 4.500, 0.5, 6 },
{ "High Throughput 4:4:4 14",
- 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5 },
+ 5, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5, 6 },
{ "Screen-Extended High Throughput 4:4:4 14",
- 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5 },
+ 9, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3500, 3850, 5.250, 0.5, 7 },
{ "Main Intra",
- 4, 0, 2, 1, 1, 1, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.500, 1.0 },
+ 4, 0, 2, 1, 1, 1, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.500, 1.0, 6 },
{ "Main 10 Intra",
- 4, 0, 2, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.875, 1.0 },
+ 4, 0, 2, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1000, 1100, 1.875, 1.0, 6 },
{ "Main 12 Intra",
- 4, 0, 2, 1, 0, 0, 1, 1, 0, 1, 0, 2, 1500, 1650, 2.250, 1.0 },
+ 4, 0, 2, 1, 0, 0, 1, 1, 0, 1, 0, 2, 1500, 1650, 2.250, 1.0, 6 },
{ "Main 4:2:2 10 Intra",
- 4, 0, 2, 1, 1, 0, 1, 0, 0, 1, 0, 2, 1667, 1833, 2.500, 0.5 },
+ 4, 0, 2, 1, 1, 0, 1, 0, 0, 1, 0, 2, 1667, 1833, 2.500, 0.5, 6 },
{ "Main 4:2:2 12 Intra",
- 4, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5 },
+ 4, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5, 6 },
{ "Main 4:4:4 Intra",
- 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5 },
+ 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 0, 2, 2000, 2200, 3.000, 0.5, 6 },
{ "Main 4:4:4 10 Intra",
- 4, 0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 2, 2500, 2750, 3.750, 0.5 },
+ 4, 0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 2, 2500, 2750, 3.750, 0.5, 6 },
{ "Main 4:4:4 12 Intra",
- 4, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 3000, 3300, 4.500, 0.5 },
+ 4, 0, 2, 1, 0, 0, 0, 0, 0, 1, 0, 2, 3000, 3300, 4.500, 0.5, 6 },
{ "Main 4:4:4 16 Intra",
- 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5 },
+ 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5, 6 },
{ "Main 4:4:4 Still Picture",
- 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 1, 2, 2000, 2200, 3.000, 0.5 },
+ 4, 0, 2, 1, 1, 1, 0, 0, 0, 1, 1, 2, 2000, 2200, 3.000, 0.5, 6 },
{ "Main 4:4:4 16 Still Picture",
- 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4000, 4400, 6.000, 0.5 },
+ 4, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 2, 4000, 4400, 6.000, 0.5, 6 },
{ "High Throughput 4:4:4 16 Intra",
- 5, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5 },
+ 5, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4000, 4400, 6.000, 0.5, 6 },
};
@@ -175,7 +179,7 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
int max_dec_pic_buffering)
{
const H265ProfileDescriptor *profile;
- int pic_size, lbr_flag, hbr_factor;
+ int pic_size, tier_flag, lbr_flag, hbr_factor;
int i;
if (ptl)
@@ -189,10 +193,13 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
pic_size = width * height;
- if (ptl)
- lbr_flag = ptl->general_lower_bit_rate_constraint_flag;
- else
- lbr_flag = profile->lower_bit_rate > 0;
+ if (ptl) {
+ tier_flag = ptl->general_tier_flag;
+ lbr_flag = ptl->general_lower_bit_rate_constraint_flag;
+ } else {
+ tier_flag = 0;
+ lbr_flag = profile->lower_bit_rate > 0;
+ }
if (profile->profile_idc == 1 || profile->profile_idc == 2) {
hbr_factor = 1;
} else if (profile->high_throughput) {
@@ -208,6 +215,9 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
const H265LevelDescriptor *level = &h265_levels[i];
int max_br, max_dpb_size;
+ if (tier_flag && !level->max_br_high)
+ continue;
+
if (pic_size > level->max_luma_ps)
continue;
if (width * width > 8 * level->max_luma_ps)
@@ -222,7 +232,7 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
if (tile_cols > level->max_tile_cols)
continue;
- if (ptl && ptl->general_tier_flag)
+ if (tier_flag)
max_br = level->max_br_high;
else
max_br = level->max_br_main;
@@ -231,14 +241,14 @@ const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *pt
if (bitrate > (int64_t)profile->cpb_nal_factor * hbr_factor * max_br)
continue;
- if (pic_size < (level->max_luma_ps >> 2))
- max_dpb_size = 16;
- else if (pic_size < (level->max_luma_ps >> 1))
- max_dpb_size = 14;
- else if (pic_size < (3 * level->max_luma_ps >> 2))
- max_dpb_size = 9;
+ if (pic_size <= (level->max_luma_ps >> 2))
+ max_dpb_size = FFMIN(4 * profile->max_dpb_pic_buf, 16);
+ else if (pic_size <= (level->max_luma_ps >> 1))
+ max_dpb_size = FFMIN(2 * profile->max_dpb_pic_buf, 16);
+ else if (pic_size <= (3 * level->max_luma_ps >> 2))
+ max_dpb_size = FFMIN(4 * profile->max_dpb_pic_buf / 3, 16);
else
- max_dpb_size = 7;
+ max_dpb_size = profile->max_dpb_pic_buf;
if (max_dec_pic_buffering > max_dpb_size)
continue;
diff --git a/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.h b/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.h
index 12c00f00771..2d5bebaecdb 100644
--- a/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.h
+++ b/chromium/third_party/ffmpeg/libavcodec/h265_profile_level.h
@@ -66,6 +66,7 @@ typedef struct H265ProfileDescriptor {
uint16_t cpb_nal_factor;
float format_capability_factor;
float min_cr_scale_factor;
+ uint8_t max_dpb_pic_buf;
} H265ProfileDescriptor;
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
index 80df417e4f7..abf08b919b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.c
@@ -1584,22 +1584,25 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
pps->entropy_coding_sync_enabled_flag = get_bits1(gb);
if (pps->tiles_enabled_flag) {
- pps->num_tile_columns = get_ue_golomb_long(gb) + 1;
- pps->num_tile_rows = get_ue_golomb_long(gb) + 1;
- if (pps->num_tile_columns <= 0 ||
- pps->num_tile_columns >= sps->width) {
+ int num_tile_columns_minus1 = get_ue_golomb(gb);
+ int num_tile_rows_minus1 = get_ue_golomb(gb);
+
+ if (num_tile_columns_minus1 < 0 ||
+ num_tile_columns_minus1 >= sps->ctb_width) {
av_log(avctx, AV_LOG_ERROR, "num_tile_columns_minus1 out of range: %d\n",
- pps->num_tile_columns - 1);
- ret = AVERROR_INVALIDDATA;
+ num_tile_columns_minus1);
+ ret = num_tile_columns_minus1 < 0 ? num_tile_columns_minus1 : AVERROR_INVALIDDATA;
goto err;
}
- if (pps->num_tile_rows <= 0 ||
- pps->num_tile_rows >= sps->height) {
+ if (num_tile_rows_minus1 < 0 ||
+ num_tile_rows_minus1 >= sps->ctb_height) {
av_log(avctx, AV_LOG_ERROR, "num_tile_rows_minus1 out of range: %d\n",
- pps->num_tile_rows - 1);
- ret = AVERROR_INVALIDDATA;
+ num_tile_rows_minus1);
+ ret = num_tile_rows_minus1 < 0 ? num_tile_rows_minus1 : AVERROR_INVALIDDATA;
goto err;
}
+ pps->num_tile_columns = num_tile_columns_minus1 + 1;
+ pps->num_tile_rows = num_tile_rows_minus1 + 1;
pps->column_width = av_malloc_array(pps->num_tile_columns, sizeof(*pps->column_width));
pps->row_height = av_malloc_array(pps->num_tile_rows, sizeof(*pps->row_height));
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.h b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.h
index bbaa9205ef8..2840dc416f3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevc_ps.h
+++ b/chromium/third_party/ffmpeg/libavcodec/hevc_ps.h
@@ -347,8 +347,8 @@ typedef struct HEVCPPS {
uint8_t tiles_enabled_flag;
uint8_t entropy_coding_sync_enabled_flag;
- int num_tile_columns; ///< num_tile_columns_minus1 + 1
- int num_tile_rows; ///< num_tile_rows_minus1 + 1
+ uint16_t num_tile_columns; ///< num_tile_columns_minus1 + 1
+ uint16_t num_tile_rows; ///< num_tile_rows_minus1 + 1
uint8_t uniform_spacing_flag;
uint8_t loop_filter_across_tiles_enabled_flag;
diff --git a/chromium/third_party/ffmpeg/libavcodec/hevcdec.c b/chromium/third_party/ffmpeg/libavcodec/hevcdec.c
index 857c10dd122..515b3465353 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hevcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hevcdec.c
@@ -408,8 +408,15 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
*fmt++ = AV_PIX_FMT_CUDA;
#endif
break;
- case AV_PIX_FMT_YUV420P12:
case AV_PIX_FMT_YUV444P:
+#if CONFIG_HEVC_VDPAU_HWACCEL
+ *fmt++ = AV_PIX_FMT_VDPAU;
+#endif
+#if CONFIG_HEVC_NVDEC_HWACCEL
+ *fmt++ = AV_PIX_FMT_CUDA;
+#endif
+ break;
+ case AV_PIX_FMT_YUV420P12:
case AV_PIX_FMT_YUV444P10:
case AV_PIX_FMT_YUV444P12:
#if CONFIG_HEVC_NVDEC_HWACCEL
diff --git a/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c b/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
index ec9da3e04fd..eec2e980b3a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
+++ b/chromium/third_party/ffmpeg/libavcodec/hq_hqa.c
@@ -248,13 +248,18 @@ static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, size_t data_size)
int width, height, quant;
const uint8_t *src = ctx->gbc.buffer;
+ if (bytestream2_get_bytes_left(&ctx->gbc) < 8 + 4*(num_slices + 1))
+ return AVERROR_INVALIDDATA;
+
width = bytestream2_get_be16(&ctx->gbc);
height = bytestream2_get_be16(&ctx->gbc);
+ ret = ff_set_dimensions(ctx->avctx, width, height);
+ if (ret < 0)
+ return ret;
+
ctx->avctx->coded_width = FFALIGN(width, 16);
ctx->avctx->coded_height = FFALIGN(height, 16);
- ctx->avctx->width = width;
- ctx->avctx->height = height;
ctx->avctx->bits_per_raw_sample = 8;
ctx->avctx->pix_fmt = AV_PIX_FMT_YUVA422P;
diff --git a/chromium/third_party/ffmpeg/libavcodec/iff.c b/chromium/third_party/ffmpeg/libavcodec/iff.c
index 33cf2e3a947..c6e2359b00e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/iff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/iff.c
@@ -280,6 +280,16 @@ static int extract_header(AVCodecContext *const avctx,
for (i = 0; i < 16; i++)
s->tvdc[i] = bytestream_get_be16(&buf);
+ if (s->ham) {
+ if (s->bpp > 8) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham);
+ return AVERROR_INVALIDDATA;
+ } if (s->ham != (s->bpp > 6 ? 6 : 4)) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u, BPP: %u\n", s->ham, s->bpp);
+ return AVERROR_INVALIDDATA;
+ }
+ }
+
if (s->masking == MASK_HAS_MASK) {
if (s->bpp >= 8 && !s->ham) {
avctx->pix_fmt = AV_PIX_FMT_RGB32;
@@ -307,9 +317,6 @@ static int extract_header(AVCodecContext *const avctx,
if (!s->bpp || s->bpp > 32) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of bitplanes: %u\n", s->bpp);
return AVERROR_INVALIDDATA;
- } else if (s->ham >= 8) {
- av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham);
- return AVERROR_INVALIDDATA;
}
av_freep(&s->ham_buf);
@@ -371,6 +378,8 @@ static av_cold int decode_end(AVCodecContext *avctx)
av_freep(&s->planebuf);
av_freep(&s->ham_buf);
av_freep(&s->ham_palbuf);
+ av_freep(&s->mask_buf);
+ av_freep(&s->mask_palbuf);
av_freep(&s->video[0]);
av_freep(&s->video[1]);
av_freep(&s->pal);
@@ -1512,7 +1521,7 @@ static int decode_frame(AVCodecContext *avctx,
buf_size -= bytestream2_tell(gb);
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
- if (!s->init && avctx->bits_per_coded_sample <= 8 &&
+ if (!s->init && avctx->bits_per_coded_sample <= 8 - (s->masking == MASK_HAS_MASK) &&
avctx->pix_fmt == AV_PIX_FMT_PAL8) {
if ((res = cmap_read_palette(avctx, (uint32_t *)frame->data[1])) < 0)
return res;
diff --git a/chromium/third_party/ffmpeg/libavcodec/ilbcdec.c b/chromium/third_party/ffmpeg/libavcodec/ilbcdec.c
index bba83a58963..a82a27525c3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/ilbcdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/ilbcdec.c
@@ -724,7 +724,7 @@ static void construct_vector (
int16_t cbvec0[SUBL];
int16_t cbvec1[SUBL];
int16_t cbvec2[SUBL];
- int32_t a32;
+ unsigned a32;
int16_t *gainPtr;
int j;
@@ -745,9 +745,9 @@ static void construct_vector (
for (j = 0; j < veclen; j++) {
a32 = SPL_MUL_16_16(*gainPtr++, cbvec0[j]);
a32 += SPL_MUL_16_16(*gainPtr++, cbvec1[j]);
- a32 += (unsigned)SPL_MUL_16_16(*gainPtr, cbvec2[j]);
+ a32 += SPL_MUL_16_16(*gainPtr, cbvec2[j]);
gainPtr -= 2;
- decvector[j] = (a32 + 8192) >> 14;
+ decvector[j] = (int)(a32 + 8192) >> 14;
}
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
index deaa09cba60..4313fdf7ac1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/interplayvideo.c
@@ -1260,7 +1260,7 @@ static int ipvideo_decode_frame(AVCodecContext *avctx,
s->decoding_map_size = ((s->avctx->width / 8) * (s->avctx->height / 8)) * 2;
s->decoding_map = buf + 8 + 14; /* 14 bits of op data */
video_data_size -= s->decoding_map_size + 14;
- if (video_data_size <= 0)
+ if (video_data_size <= 0 || s->decoding_map_size == 0)
return AVERROR_INVALIDDATA;
if (buf_size < 8 + s->decoding_map_size + 14 + video_data_size)
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
index 8e90980976e..3f50bf9fb34 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000.c
@@ -247,6 +247,11 @@ static void init_band_stepsize(AVCodecContext *avctx,
}
}
+ if (band->f_stepsize > (INT_MAX >> 15)) {
+ band->f_stepsize = 0;
+ av_log(avctx, AV_LOG_ERROR, "stepsize out of range\n");
+ }
+
band->i_stepsize = band->f_stepsize * (1 << 15);
/* FIXME: In OpenJPEG code stepsize = stepsize * 0.5. Why?
diff --git a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
index 7749c980e5c..019dc81f56b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jpeg2000dec.c
@@ -829,18 +829,24 @@ static uint8_t get_tlm(Jpeg2000DecoderContext *s, int n)
return 0;
}
-static uint8_t get_plt(Jpeg2000DecoderContext *s, int n)
+static int get_plt(Jpeg2000DecoderContext *s, int n)
{
int i;
+ int v;
av_log(s->avctx, AV_LOG_DEBUG,
"PLT marker at pos 0x%X\n", bytestream2_tell(&s->g) - 4);
+ if (n < 4)
+ return AVERROR_INVALIDDATA;
+
/*Zplt =*/ bytestream2_get_byte(&s->g);
for (i = 0; i < n - 3; i++) {
- bytestream2_get_byte(&s->g);
+ v = bytestream2_get_byte(&s->g);
}
+ if (v & 0x80)
+ return AVERROR_INVALIDDATA;
return 0;
}
@@ -1171,7 +1177,10 @@ static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2
step_x = FFMIN(step_x, rlevel->log2_prec_width + reducedresno);
step_y = FFMIN(step_y, rlevel->log2_prec_height + reducedresno);
}
- av_assert0(step_x < 32 && step_y < 32);
+ if (step_x >= 31 || step_y >= 31){
+ avpriv_request_sample(s->avctx, "CPRL with large step");
+ return AVERROR_PATCHWELCOME;
+ }
step_x = 1<<step_x;
step_y = 1<<step_y;
diff --git a/chromium/third_party/ffmpeg/libavcodec/jvdec.c b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
index 4337d5681ec..b06e7cf2bfe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/jvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/jvdec.c
@@ -163,13 +163,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
return AVERROR_INVALIDDATA;
}
- if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
- return ret;
if (video_type == 0 || video_type == 1) {
GetBitContext gb;
init_get_bits(&gb, buf, 8 * video_size);
+ if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
+ return ret;
+
if (avctx->height/8 * (avctx->width/8) > 4 * video_size) {
av_log(avctx, AV_LOG_ERROR, "Insufficient input data for dimensions\n");
return AVERROR_INVALIDDATA;
@@ -184,6 +185,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
buf += video_size;
} else if (video_type == 2) {
int v = *buf++;
+
+ av_frame_unref(s->frame);
+ if ((ret = ff_get_buffer(avctx, s->frame, AV_GET_BUFFER_FLAG_REF)) < 0)
+ return ret;
+
for (j = 0; j < avctx->height; j++)
memset(s->frame->data[0] + j * s->frame->linesize[0],
v, avctx->width);
diff --git a/chromium/third_party/ffmpeg/libavcodec/libdav1d.c b/chromium/third_party/ffmpeg/libavcodec/libdav1d.c
index 30c6eccfef3..12c63245f83 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libdav1d.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libdav1d.c
@@ -38,6 +38,7 @@ typedef struct Libdav1dContext {
Dav1dData data;
int tile_threads;
+ int frame_threads;
int apply_grain;
} Libdav1dContext;
@@ -48,6 +49,10 @@ static const enum AVPixelFormat pix_fmt[][3] = {
[DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12 },
};
+static const enum AVPixelFormat pix_fmt_rgb[3] = {
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12,
+};
+
static void libdav1d_log_callback(void *opaque, const char *fmt, va_list vl)
{
AVCodecContext *c = opaque;
@@ -114,6 +119,7 @@ static av_cold int libdav1d_init(AVCodecContext *c)
{
Libdav1dContext *dav1d = c->priv_data;
Dav1dSettings s;
+ int threads = (c->thread_count ? c->thread_count : av_cpu_count()) * 3 / 2;
int res;
av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version());
@@ -124,9 +130,16 @@ static av_cold int libdav1d_init(AVCodecContext *c)
s.allocator.cookie = dav1d;
s.allocator.alloc_picture_callback = libdav1d_picture_allocator;
s.allocator.release_picture_callback = libdav1d_picture_release;
- s.n_tile_threads = dav1d->tile_threads;
s.apply_grain = dav1d->apply_grain;
- s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : av_cpu_count(), DAV1D_MAX_FRAME_THREADS);
+
+ s.n_tile_threads = dav1d->tile_threads
+ ? dav1d->tile_threads
+ : FFMIN(floor(sqrt(threads)), DAV1D_MAX_TILE_THREADS);
+ s.n_frame_threads = dav1d->frame_threads
+ ? dav1d->frame_threads
+ : FFMIN(ceil(threads / s.n_tile_threads), DAV1D_MAX_FRAME_THREADS);
+ av_log(c, AV_LOG_DEBUG, "Using %d frame threads, %d tile threads\n",
+ s.n_frame_threads, s.n_tile_threads);
res = dav1d_open(&dav1d->c, &s);
if (res < 0)
@@ -197,7 +210,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
return res;
}
- av_assert0(p->data[0] != NULL);
+ av_assert0(p->data[0] && p->allocator_data);
// This requires the custom allocator above
frame->buf[0] = av_buffer_ref(p->allocator_data);
@@ -214,7 +227,8 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
frame->linesize[2] = p->stride[1];
c->profile = p->seq_hdr->profile;
- frame->format = c->pix_fmt = pix_fmt[p->p.layout][p->seq_hdr->hbd];
+ c->level = ((p->seq_hdr->operating_points[0].major_level - 2) << 2)
+ | p->seq_hdr->operating_points[0].minor_level;
frame->width = p->p.w;
frame->height = p->p.h;
if (c->width != p->p.w || c->height != p->p.h) {
@@ -236,6 +250,14 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
frame->color_trc = c->color_trc = (enum AVColorTransferCharacteristic) p->seq_hdr->trc;
frame->color_range = c->color_range = p->seq_hdr->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
+ if (p->p.layout == DAV1D_PIXEL_LAYOUT_I444 &&
+ p->seq_hdr->mtrx == DAV1D_MC_IDENTITY &&
+ p->seq_hdr->pri == DAV1D_COLOR_PRI_BT709 &&
+ p->seq_hdr->trc == DAV1D_TRC_SRGB)
+ frame->format = c->pix_fmt = pix_fmt_rgb[p->seq_hdr->hbd];
+ else
+ frame->format = c->pix_fmt = pix_fmt[p->p.layout][p->seq_hdr->hbd];
+
// match timestamps and packet size
frame->pts = frame->best_effort_timestamp = p->m.timestamp;
#if FF_API_PKT_PTS
@@ -317,7 +339,8 @@ static av_cold int libdav1d_close(AVCodecContext *c)
#define OFFSET(x) offsetof(Libdav1dContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption libdav1d_options[] = {
- { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, DAV1D_MAX_TILE_THREADS, VD },
+ { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
+ { "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
{ "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VD },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c b/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
index ecf690a5530..89cbbb41b68 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvorbisdec.c
@@ -49,8 +49,16 @@ static int oggvorbis_decode_init(AVCodecContext *avccontext) {
vorbis_comment_init(&context->vc) ;
if(p[0] == 0 && p[1] == 30) {
+ int sizesum = 0;
for(i = 0; i < 3; i++){
hsizes[i] = bytestream_get_be16((const uint8_t **)&p);
+ sizesum += 2 + hsizes[i];
+ if (sizesum > avccontext->extradata_size) {
+ av_log(avccontext, AV_LOG_ERROR, "vorbis extradata too small\n");
+ ret = AVERROR_INVALIDDATA;
+ goto error;
+ }
+
headers[i] = p;
p += hsizes[i];
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
index c823b8ad8bf..feb52ea0dd0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libvpxenc.c
@@ -978,7 +978,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out)
are only good through the next vpx_codec call */
while ((pkt = vpx_codec_get_cx_data(&ctx->encoder, &iter)) &&
(!ctx->is_alpha ||
- (ctx->is_alpha && (pkt_alpha = vpx_codec_get_cx_data(&ctx->encoder_alpha, &iter_alpha))))) {
+ (pkt_alpha = vpx_codec_get_cx_data(&ctx->encoder_alpha, &iter_alpha)))) {
switch (pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT:
if (!size) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx264.c b/chromium/third_party/ffmpeg/libavcodec/libx264.c
index a3493f393da..dc4b4b100de 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libx264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libx264.c
@@ -285,16 +285,18 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
int nnal, i, ret;
x264_picture_t pic_out = {0};
int pict_type;
+ int bit_depth;
int64_t *out_opaque;
AVFrameSideData *sd;
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
#if X264_BUILD >= 153
- if (x4->params.i_bitdepth > 8)
+ bit_depth = x4->params.i_bitdepth;
#else
- if (x264_bit_depth > 8)
+ bit_depth = x264_bit_depth;
#endif
+ if (bit_depth > 8)
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);
@@ -359,45 +361,50 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
if (frame->interlaced_frame == 0) {
int mbx = (frame->width + MB_SIZE - 1) / MB_SIZE;
int mby = (frame->height + MB_SIZE - 1) / MB_SIZE;
+ int qp_range = 51 + 6 * (bit_depth - 8);
int nb_rois;
- AVRegionOfInterest* roi;
- float* qoffsets;
+ const AVRegionOfInterest *roi;
+ uint32_t roi_size;
+ float *qoffsets;
+
+ roi = (const AVRegionOfInterest*)sd->data;
+ roi_size = roi->self_size;
+ if (!roi_size || sd->size % roi_size != 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid AVRegionOfInterest.self_size.\n");
+ return AVERROR(EINVAL);
+ }
+ nb_rois = sd->size / roi_size;
+
qoffsets = av_mallocz_array(mbx * mby, sizeof(*qoffsets));
if (!qoffsets)
return AVERROR(ENOMEM);
- nb_rois = sd->size / sizeof(AVRegionOfInterest);
- roi = (AVRegionOfInterest*)sd->data;
- for (int count = 0; count < nb_rois; count++) {
- int starty = FFMIN(mby, roi->top / MB_SIZE);
- int endy = FFMIN(mby, (roi->bottom + MB_SIZE - 1)/ MB_SIZE);
- int startx = FFMIN(mbx, roi->left / MB_SIZE);
- int endx = FFMIN(mbx, (roi->right + MB_SIZE - 1)/ MB_SIZE);
+ // This list must be iterated in reverse because the first
+ // region in the list applies when regions overlap.
+ for (int i = nb_rois - 1; i >= 0; i--) {
+ int startx, endx, starty, endy;
float qoffset;
+ roi = (const AVRegionOfInterest*)(sd->data + roi_size * i);
+
+ starty = FFMIN(mby, roi->top / MB_SIZE);
+ endy = FFMIN(mby, (roi->bottom + MB_SIZE - 1)/ MB_SIZE);
+ startx = FFMIN(mbx, roi->left / MB_SIZE);
+ endx = FFMIN(mbx, (roi->right + MB_SIZE - 1)/ MB_SIZE);
+
if (roi->qoffset.den == 0) {
av_free(qoffsets);
- av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.qoffset.den should not be zero.\n");
+ av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.qoffset.den must not be zero.\n");
return AVERROR(EINVAL);
}
qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den;
- qoffset = av_clipf(qoffset, -1.0f, 1.0f);
-
- // 25 is a number that I think it is a possible proper scale value.
- qoffset = qoffset * 25;
+ qoffset = av_clipf(qoffset * qp_range, -qp_range, +qp_range);
for (int y = starty; y < endy; y++) {
for (int x = startx; x < endx; x++) {
qoffsets[x + y*mbx] = qoffset;
}
}
-
- if (roi->self_size == 0) {
- av_free(qoffsets);
- av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.self_size should be set to sizeof(AVRegionOfInterest).\n");
- return AVERROR(EINVAL);
- }
- roi = (AVRegionOfInterest*)((char*)roi + roi->self_size);
}
x4->pic.prop.quant_offsets = qoffsets;
@@ -821,8 +828,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
x4->params.vui.i_sar_height = sh;
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;
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
+ x4->params.i_fps_num = avctx->framerate.num;
+ x4->params.i_fps_den = avctx->framerate.den;
+ } else {
+ 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 & AV_CODEC_FLAG_PSNR;
diff --git a/chromium/third_party/ffmpeg/libavcodec/libx265.c b/chromium/third_party/ffmpeg/libavcodec/libx265.c
index fe39f452417..665b780643e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/libx265.c
+++ b/chromium/third_party/ffmpeg/libavcodec/libx265.c
@@ -110,8 +110,13 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
}
ctx->params->frameNumThreads = avctx->thread_count;
- ctx->params->fpsNum = avctx->time_base.den;
- ctx->params->fpsDenom = avctx->time_base.num * avctx->ticks_per_frame;
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
+ ctx->params->fpsNum = avctx->framerate.num;
+ ctx->params->fpsDenom = avctx->framerate.den;
+ } else {
+ 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;
ctx->params->bEnablePsnr = !!(avctx->flags & AV_CODEC_FLAG_PSNR);
@@ -128,6 +133,14 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL);
}
+
+ ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
+
+ ctx->params->vui.bEnableVideoFullRangeFlag = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
+ avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
+ avctx->color_range == AVCOL_RANGE_JPEG;
+
if ((avctx->color_primaries <= AVCOL_PRI_SMPTE432 &&
avctx->color_primaries != AVCOL_PRI_UNSPECIFIED) ||
(avctx->color_trc <= AVCOL_TRC_ARIB_STD_B67 &&
@@ -135,7 +148,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
(avctx->colorspace <= AVCOL_SPC_ICTCP &&
avctx->colorspace != AVCOL_SPC_UNSPECIFIED)) {
- ctx->params->vui.bEnableVideoSignalTypePresentFlag = 1;
ctx->params->vui.bEnableColorDescriptionPresentFlag = 1;
// x265 validates the parameters internally
@@ -304,27 +316,36 @@ static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *fr
int mb_size = (ctx->params->rc.qgSize == 8) ? 8 : 16;
int mbx = (frame->width + mb_size - 1) / mb_size;
int mby = (frame->height + mb_size - 1) / mb_size;
+ int qp_range = 51 + 6 * (pic->bitDepth - 8);
int nb_rois;
- AVRegionOfInterest *roi;
+ const AVRegionOfInterest *roi;
+ uint32_t roi_size;
float *qoffsets; /* will be freed after encode is called. */
+
+ roi = (const AVRegionOfInterest*)sd->data;
+ roi_size = roi->self_size;
+ if (!roi_size || sd->size % roi_size != 0) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid AVRegionOfInterest.self_size.\n");
+ return AVERROR(EINVAL);
+ }
+ nb_rois = sd->size / roi_size;
+
qoffsets = av_mallocz_array(mbx * mby, sizeof(*qoffsets));
if (!qoffsets)
return AVERROR(ENOMEM);
- nb_rois = sd->size / sizeof(AVRegionOfInterest);
- roi = (AVRegionOfInterest*)sd->data;
- for (int count = 0; count < nb_rois; count++) {
- int starty = FFMIN(mby, roi->top / mb_size);
- int endy = FFMIN(mby, (roi->bottom + mb_size - 1)/ mb_size);
- int startx = FFMIN(mbx, roi->left / mb_size);
- int endx = FFMIN(mbx, (roi->right + mb_size - 1)/ mb_size);
+ // This list must be iterated in reverse because the first
+ // region in the list applies when regions overlap.
+ for (int i = nb_rois - 1; i >= 0; i--) {
+ int startx, endx, starty, endy;
float qoffset;
- if (roi->self_size == 0) {
- av_free(qoffsets);
- av_log(ctx, AV_LOG_ERROR, "AVRegionOfInterest.self_size must be set to sizeof(AVRegionOfInterest).\n");
- return AVERROR(EINVAL);
- }
+ roi = (const AVRegionOfInterest*)(sd->data + roi_size * i);
+
+ starty = FFMIN(mby, roi->top / mb_size);
+ endy = FFMIN(mby, (roi->bottom + mb_size - 1)/ mb_size);
+ startx = FFMIN(mbx, roi->left / mb_size);
+ endx = FFMIN(mbx, (roi->right + mb_size - 1)/ mb_size);
if (roi->qoffset.den == 0) {
av_free(qoffsets);
@@ -332,18 +353,11 @@ static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *fr
return AVERROR(EINVAL);
}
qoffset = roi->qoffset.num * 1.0f / roi->qoffset.den;
- qoffset = av_clipf(qoffset, -1.0f, 1.0f);
-
- /* qp range of x265 is from 0 to 51, just choose 25 as the scale value,
- * so the range of final qoffset is [-25.0, 25.0].
- */
- qoffset = qoffset * 25;
+ qoffset = av_clipf(qoffset * qp_range, -qp_range, +qp_range);
for (int y = starty; y < endy; y++)
for (int x = startx; x < endx; x++)
qoffsets[x + y*mbx] = qoffset;
-
- roi = (AVRegionOfInterest*)((char*)roi + roi->self_size);
}
pic->quantOffsets = qoffsets;
@@ -449,8 +463,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
static const enum AVPixelFormat x265_csp_eight[] = {
AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_GRAY8,
AV_PIX_FMT_NONE
@@ -458,8 +475,11 @@ static const enum AVPixelFormat x265_csp_eight[] = {
static const enum AVPixelFormat x265_csp_ten[] = {
AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10,
@@ -472,8 +492,11 @@ static const enum AVPixelFormat x265_csp_ten[] = {
static const enum AVPixelFormat x265_csp_twelve[] = {
AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUVJ420P,
AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUVJ422P,
AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_GBRP,
AV_PIX_FMT_YUV420P10,
AV_PIX_FMT_YUV422P10,
diff --git a/chromium/third_party/ffmpeg/libavcodec/loco.c b/chromium/third_party/ffmpeg/libavcodec/loco.c
index 741db3bdcec..e8c62b8178b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/loco.c
+++ b/chromium/third_party/ffmpeg/libavcodec/loco.c
@@ -295,6 +295,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
avpriv_request_sample(avctx, "LOCO codec version %i", version);
}
+ if (l->lossy > 65536U) {
+ av_log(avctx, AV_LOG_ERROR, "lossy %i is too large\n", l->lossy);
+ return AVERROR_INVALIDDATA;
+ }
+
l->mode = AV_RL32(avctx->extradata + 4);
switch (l->mode) {
case LOCO_CYUY2:
diff --git a/chromium/third_party/ffmpeg/libavcodec/m101.c b/chromium/third_party/ffmpeg/libavcodec/m101.c
index d2549668fd6..70f1da4f457 100644
--- a/chromium/third_party/ffmpeg/libavcodec/m101.c
+++ b/chromium/third_party/ffmpeg/libavcodec/m101.c
@@ -61,7 +61,7 @@ static int m101_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
stride = AV_RL32(avctx->extradata + 5*4);
if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10)
- min_stride = (avctx->width + 15) / 16 * 20;
+ min_stride = (avctx->width + 15) / 16 * 40;
if (stride < min_stride || avpkt->size < stride * (uint64_t)avctx->height) {
av_log(avctx, AV_LOG_ERROR, "stride (%d) is invalid for packet sized %d\n",
diff --git a/chromium/third_party/ffmpeg/libavcodec/magicyuv.c b/chromium/third_party/ffmpeg/libavcodec/magicyuv.c
index 1a129c26198..f4fb2a78097 100644
--- a/chromium/third_party/ffmpeg/libavcodec/magicyuv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/magicyuv.c
@@ -592,6 +592,13 @@ static int magy_decode_frame(AVCodecContext *avctx, void *data,
s->magy_decode_slice = magy_decode_slice10;
s->bps = 10;
break;
+ case 0x76:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
+ s->max = 1024;
+ s->huff_build = huff_build10;
+ s->magy_decode_slice = magy_decode_slice10;
+ s->bps = 10;
+ break;
case 0x6d:
avctx->pix_fmt = AV_PIX_FMT_GBRP10;
s->decorrelate = 1;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mediacodecdec.c b/chromium/third_party/ffmpeg/libavcodec/mediacodecdec.c
index 3a4240aa952..e353e34bd54 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mediacodecdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mediacodecdec.c
@@ -461,6 +461,7 @@ static int mediacodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
ret = ff_mediacodec_dec_send(avctx, s->ctx, &null_pkt, true);
if (ret < 0)
return ret;
+ return ff_mediacodec_dec_receive(avctx, s->ctx, frame, true);
} else if (ret == AVERROR(EAGAIN) && s->ctx->current_input_buffer < 0) {
return ff_mediacodec_dec_receive(avctx, s->ctx, frame, true);
} else if (ret < 0) {
diff --git a/chromium/third_party/ffmpeg/libavcodec/mediacodecdec_common.c b/chromium/third_party/ffmpeg/libavcodec/mediacodecdec_common.c
index 7c2661f6726..1656cd66645 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mediacodecdec_common.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mediacodecdec_common.c
@@ -631,21 +631,21 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
"Queued input buffer %zd size=%zd ts=%"PRIi64"\n", index, size, pts);
s->draining = 1;
- break;
- } else {
- size = FFMIN(pkt->size - offset, size);
- memcpy(data, pkt->data + offset, size);
- offset += size;
+ return 0;
+ }
- status = ff_AMediaCodec_queueInputBuffer(codec, index, 0, size, pts, 0);
- if (status < 0) {
- av_log(avctx, AV_LOG_ERROR, "Failed to queue input buffer (status = %d)\n", status);
- return AVERROR_EXTERNAL;
- }
+ size = FFMIN(pkt->size - offset, size);
+ memcpy(data, pkt->data + offset, size);
+ offset += size;
- av_log(avctx, AV_LOG_TRACE,
- "Queued input buffer %zd size=%zd ts=%"PRIi64"\n", index, size, pts);
+ status = ff_AMediaCodec_queueInputBuffer(codec, index, 0, size, pts, 0);
+ if (status < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to queue input buffer (status = %d)\n", status);
+ return AVERROR_EXTERNAL;
}
+
+ av_log(avctx, AV_LOG_TRACE,
+ "Queued input buffer %zd size=%zd ts=%"PRIi64"\n", index, size, pts);
}
if (offset == 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/cabac.h b/chromium/third_party/ffmpeg/libavcodec/mips/cabac.h
index 82cee29d732..2a05e5ab3cc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/cabac.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/cabac.h
@@ -72,7 +72,7 @@ static av_always_inline int get_cabac_inline(CABACContext *c,
"and %[tmp0], %[c_low], %[cabac_mask] \n\t"
"bnez %[tmp0], 1f \n\t"
- PTR_ADDI "%[tmp0], %[c_low], -0X01 \n\t"
+ PTR_ADDIU "%[tmp0], %[c_low], -0x01 \n\t"
"xor %[tmp0], %[c_low], %[tmp0] \n\t"
PTR_SRA "%[tmp0], %[tmp0], 0x0f \n\t"
PTR_ADDU "%[tmp0], %[tmp0], %[tables] \n\t"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c
index 18058e492d6..e4aba08661a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mips/mpegvideo_mmi.c
@@ -410,9 +410,9 @@ void ff_dct_unquantize_mpeg2_intra_mmi(MpegEncContext *s, int16_t *block,
"psubh %[ftmp2], %[ftmp2], %[ftmp8] \n\t"
"pandn %[ftmp5], %[ftmp5], %[ftmp1] \n\t"
"pandn %[ftmp6], %[ftmp6], %[ftmp2] \n\t"
- PTR_ADDIU "%[addr0], %[addr0], 0x10 \n\t"
MMI_SDXC1(%[ftmp5], %[addr0], %[block], 0x00)
MMI_SDXC1(%[ftmp6], %[addr0], %[block], 0x08)
+ PTR_ADDIU "%[addr0], %[addr0], 0x10 \n\t"
"blez %[addr0], 1b \n\t"
: [ftmp0]"=&f"(ftmp[0]), [ftmp1]"=&f"(ftmp[1]),
[ftmp2]"=&f"(ftmp[2]), [ftmp3]"=&f"(ftmp[3]),
diff --git a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
index e82c1854330..a65bc8df15d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mjpegdec.c
@@ -453,273 +453,275 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
avpriv_request_sample(s->avctx, "progressively coded interlaced picture");
return AVERROR_INVALIDDATA;
}
- } else{
+ } else {
if (s->v_max == 1 && s->h_max == 1 && s->lossless==1 && (nb_components==3 || nb_components==4))
s->rgb = 1;
else if (!s->lossless)
s->rgb = 0;
- /* XXX: not complete test ! */
- pix_fmt_id = ((unsigned)s->h_count[0] << 28) | (s->v_count[0] << 24) |
- (s->h_count[1] << 20) | (s->v_count[1] << 16) |
- (s->h_count[2] << 12) | (s->v_count[2] << 8) |
- (s->h_count[3] << 4) | s->v_count[3];
- av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
- /* NOTE we do not allocate pictures large enough for the possible
- * padding of h/v_count being 4 */
- if (!(pix_fmt_id & 0xD0D0D0D0))
- pix_fmt_id -= (pix_fmt_id & 0xF0F0F0F0) >> 1;
- if (!(pix_fmt_id & 0x0D0D0D0D))
- pix_fmt_id -= (pix_fmt_id & 0x0F0F0F0F) >> 1;
-
- for (i = 0; i < 8; i++) {
- int j = 6 + (i&1) - (i&6);
- int is = (pix_fmt_id >> (4*i)) & 0xF;
- int js = (pix_fmt_id >> (4*j)) & 0xF;
-
- if (is == 1 && js != 2 && (i < 2 || i > 5))
- js = (pix_fmt_id >> ( 8 + 4*(i&1))) & 0xF;
- if (is == 1 && js != 2 && (i < 2 || i > 5))
- js = (pix_fmt_id >> (16 + 4*(i&1))) & 0xF;
-
- if (is == 1 && js == 2) {
- if (i & 1) s->upscale_h[j/2] = 1;
- else s->upscale_v[j/2] = 1;
- }
- }
-
- switch (pix_fmt_id) {
- case 0x11111100:
- if (s->rgb)
- s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_BGR48;
- else {
- if ( s->adobe_transform == 0
- || s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
- s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
- } else {
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- else s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ /* XXX: not complete test ! */
+ pix_fmt_id = ((unsigned)s->h_count[0] << 28) | (s->v_count[0] << 24) |
+ (s->h_count[1] << 20) | (s->v_count[1] << 16) |
+ (s->h_count[2] << 12) | (s->v_count[2] << 8) |
+ (s->h_count[3] << 4) | s->v_count[3];
+ av_log(s->avctx, AV_LOG_DEBUG, "pix fmt id %x\n", pix_fmt_id);
+ /* NOTE we do not allocate pictures large enough for the possible
+ * padding of h/v_count being 4 */
+ if (!(pix_fmt_id & 0xD0D0D0D0))
+ pix_fmt_id -= (pix_fmt_id & 0xF0F0F0F0) >> 1;
+ if (!(pix_fmt_id & 0x0D0D0D0D))
+ pix_fmt_id -= (pix_fmt_id & 0x0F0F0F0F) >> 1;
+
+ for (i = 0; i < 8; i++) {
+ int j = 6 + (i&1) - (i&6);
+ int is = (pix_fmt_id >> (4*i)) & 0xF;
+ int js = (pix_fmt_id >> (4*j)) & 0xF;
+
+ if (is == 1 && js != 2 && (i < 2 || i > 5))
+ js = (pix_fmt_id >> ( 8 + 4*(i&1))) & 0xF;
+ if (is == 1 && js != 2 && (i < 2 || i > 5))
+ js = (pix_fmt_id >> (16 + 4*(i&1))) & 0xF;
+
+ if (is == 1 && js == 2) {
+ if (i & 1) s->upscale_h[j/2] = 1;
+ else s->upscale_v[j/2] = 1;
}
}
- av_assert0(s->nb_components == 3);
- break;
- case 0x11111111:
- if (s->rgb)
- s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA64;
- else {
+
+ switch (pix_fmt_id) {
+ case 0x11111100:
+ if (s->rgb)
+ s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_BGR48;
+ else {
+ if ( s->adobe_transform == 0
+ || s->component_id[0] == 'R' - 1 && s->component_id[1] == 'G' - 1 && s->component_id[2] == 'B' - 1) {
+ s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
+ } else {
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ else s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
+ }
+ av_assert0(s->nb_components == 3);
+ break;
+ case 0x11111111:
+ if (s->rgb)
+ s->avctx->pix_fmt = s->bits <= 9 ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA64;
+ else {
+ 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:
+ case 0x22111111:
if (s->adobe_transform == 0 && s->bits <= 8) {
s->avctx->pix_fmt = AV_PIX_FMT_GBRAP;
+ s->upscale_v[1] = s->upscale_v[2] = 1;
+ s->upscale_h[1] = s->upscale_h[2] = 1;
+ } else if (s->adobe_transform == 2 && s->bits <= 8) {
+ s->avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
+ s->upscale_v[1] = s->upscale_v[2] = 1;
+ s->upscale_h[1] = s->upscale_h[2] = 1;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
} else {
- s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
+ 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);
- break;
- case 0x22111122:
- case 0x22111111:
- if (s->adobe_transform == 0 && s->bits <= 8) {
- s->avctx->pix_fmt = AV_PIX_FMT_GBRAP;
- s->upscale_v[1] = s->upscale_v[2] = 1;
- s->upscale_h[1] = s->upscale_h[2] = 1;
- } else if (s->adobe_transform == 2 && s->bits <= 8) {
- s->avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
- s->upscale_v[1] = s->upscale_v[2] = 1;
- s->upscale_h[1] = s->upscale_h[2] = 1;
+ av_assert0(s->nb_components == 4);
+ break;
+ case 0x12121100:
+ case 0x22122100:
+ case 0x21211100:
+ case 0x22211200:
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ else
+ goto unk_pixfmt;
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;
+ break;
+ case 0x22221100:
+ case 0x22112200:
+ case 0x11222200:
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ else
+ goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- }
- av_assert0(s->nb_components == 4);
- break;
- case 0x12121100:
- case 0x22122100:
- case 0x21211100:
- case 0x22211200:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- else
- goto unk_pixfmt;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- break;
- case 0x22221100:
- case 0x22112200:
- case 0x11222200:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- else
- goto unk_pixfmt;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- break;
- case 0x11000000:
- case 0x13000000:
- case 0x14000000:
- case 0x31000000:
- case 0x33000000:
- case 0x34000000:
- case 0x41000000:
- case 0x43000000:
- case 0x44000000:
- if(s->bits <= 8)
- s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
- else
- s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
- break;
- case 0x12111100:
- case 0x14121200:
- case 0x14111100:
- case 0x22211100:
- case 0x22112100:
- if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
- if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ break;
+ case 0x11000000:
+ case 0x13000000:
+ case 0x14000000:
+ case 0x31000000:
+ case 0x33000000:
+ case 0x34000000:
+ case 0x41000000:
+ case 0x43000000:
+ case 0x44000000:
+ if(s->bits <= 8)
+ s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
else
+ s->avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+ break;
+ case 0x12111100:
+ case 0x14121200:
+ case 0x14111100:
+ case 0x22211100:
+ case 0x22112100:
+ if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ else
+ goto unk_pixfmt;
+ s->upscale_v[0] = s->upscale_v[1] = 1;
+ } else {
+ if (pix_fmt_id == 0x14111100)
+ s->upscale_v[1] = s->upscale_v[2] = 1;
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+ else
+ goto unk_pixfmt;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
+ break;
+ case 0x21111100:
+ if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
+ if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ else
+ goto unk_pixfmt;
+ s->upscale_h[0] = s->upscale_h[1] = 1;
+ } else {
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+ else s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
+ break;
+ case 0x31111100:
+ if (s->bits > 8)
goto unk_pixfmt;
- s->upscale_v[0] = s->upscale_v[1] = 1;
- } else {
- if (pix_fmt_id == 0x14111100)
- s->upscale_v[1] = s->upscale_v[2] = 1;
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+ s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ s->upscale_h[1] = s->upscale_h[2] = 2;
+ break;
+ case 0x22121100:
+ case 0x22111200:
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
else
goto unk_pixfmt;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- }
- break;
- case 0x21111100:
- if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
- if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ break;
+ case 0x22111100:
+ case 0x23111100:
+ case 0x42111100:
+ case 0x24111100:
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
+ else s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
+ s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ if (pix_fmt_id == 0x42111100) {
+ if (s->bits > 8)
+ goto unk_pixfmt;
+ s->upscale_h[1] = s->upscale_h[2] = 1;
+ } else if (pix_fmt_id == 0x24111100) {
+ if (s->bits > 8)
+ goto unk_pixfmt;
+ s->upscale_v[1] = s->upscale_v[2] = 1;
+ } else if (pix_fmt_id == 0x23111100) {
+ if (s->bits > 8)
+ goto unk_pixfmt;
+ s->upscale_v[1] = s->upscale_v[2] = 2;
+ }
+ break;
+ case 0x41111100:
+ if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV411P : AV_PIX_FMT_YUVJ411P;
else
goto unk_pixfmt;
- s->upscale_h[0] = s->upscale_h[1] = 1;
- } else {
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
- else s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ break;
+ default:
+ unk_pixfmt:
+ avpriv_report_missing_feature(s->avctx, "Pixel format 0x%x bits:%d", pix_fmt_id, s->bits);
+ memset(s->upscale_h, 0, sizeof(s->upscale_h));
+ memset(s->upscale_v, 0, sizeof(s->upscale_v));
+ return AVERROR_PATCHWELCOME;
}
- break;
- case 0x31111100:
- if (s->bits > 8)
- goto unk_pixfmt;
- s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- s->upscale_h[1] = s->upscale_h[2] = 2;
- break;
- case 0x22121100:
- case 0x22111200:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
- else
- goto unk_pixfmt;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- break;
- case 0x22111100:
- case 0x23111100:
- case 0x42111100:
- case 0x24111100:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
- else s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- if (pix_fmt_id == 0x42111100) {
- if (s->bits > 8)
- goto unk_pixfmt;
- s->upscale_h[1] = s->upscale_h[2] = 1;
- } else if (pix_fmt_id == 0x24111100) {
- if (s->bits > 8)
- goto unk_pixfmt;
- s->upscale_v[1] = s->upscale_v[2] = 1;
- } else if (pix_fmt_id == 0x23111100) {
- if (s->bits > 8)
- goto unk_pixfmt;
- s->upscale_v[1] = s->upscale_v[2] = 2;
+ if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->avctx->lowres) {
+ avpriv_report_missing_feature(s->avctx, "Lowres for weird subsampling");
+ return AVERROR_PATCHWELCOME;
}
- break;
- case 0x41111100:
- if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV411P : AV_PIX_FMT_YUVJ411P;
- else
- goto unk_pixfmt;
- s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
- break;
- default:
-unk_pixfmt:
- avpriv_report_missing_feature(s->avctx, "Pixel format 0x%x bits:%d", pix_fmt_id, s->bits);
- memset(s->upscale_h, 0, sizeof(s->upscale_h));
- memset(s->upscale_v, 0, sizeof(s->upscale_v));
- return AVERROR_PATCHWELCOME;
- }
- if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->avctx->lowres) {
- avpriv_report_missing_feature(s->avctx, "Lowres for weird subsampling");
- return AVERROR_PATCHWELCOME;
- }
- if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->progressive && s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
- avpriv_report_missing_feature(s->avctx, "progressive for weird subsampling");
- return AVERROR_PATCHWELCOME;
- }
- if (s->ls) {
- memset(s->upscale_h, 0, sizeof(s->upscale_h));
- memset(s->upscale_v, 0, sizeof(s->upscale_v));
- if (s->nb_components == 3) {
- s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
- } else if (s->nb_components != 1) {
- av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
+ if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->progressive && s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
+ avpriv_report_missing_feature(s->avctx, "progressive for weird subsampling");
return AVERROR_PATCHWELCOME;
- } 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;
- }
+ }
+ if (s->ls) {
+ memset(s->upscale_h, 0, sizeof(s->upscale_h));
+ memset(s->upscale_v, 0, sizeof(s->upscale_v));
+ if (s->nb_components == 3) {
+ s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
+ } else if (s->nb_components != 1) {
+ av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
+ return AVERROR_PATCHWELCOME;
+ } 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;
- }
+ 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;
+ }
- if (s->avctx->pix_fmt == s->hwaccel_sw_pix_fmt && !size_change) {
- s->avctx->pix_fmt = s->hwaccel_pix_fmt;
- } else {
- enum AVPixelFormat pix_fmts[] = {
+ if (s->avctx->pix_fmt == s->hwaccel_sw_pix_fmt && !size_change) {
+ s->avctx->pix_fmt = s->hwaccel_pix_fmt;
+ } else {
+ enum AVPixelFormat pix_fmts[] = {
#if CONFIG_MJPEG_NVDEC_HWACCEL
- AV_PIX_FMT_CUDA,
+ AV_PIX_FMT_CUDA,
#endif
#if CONFIG_MJPEG_VAAPI_HWACCEL
- AV_PIX_FMT_VAAPI,
+ AV_PIX_FMT_VAAPI,
#endif
- s->avctx->pix_fmt,
- AV_PIX_FMT_NONE,
- };
- s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);
- if (s->hwaccel_pix_fmt < 0)
- return AVERROR(EINVAL);
+ s->avctx->pix_fmt,
+ AV_PIX_FMT_NONE,
+ };
+ s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);
+ if (s->hwaccel_pix_fmt < 0)
+ return AVERROR(EINVAL);
- s->hwaccel_sw_pix_fmt = s->avctx->pix_fmt;
- s->avctx->pix_fmt = s->hwaccel_pix_fmt;
- }
+ s->hwaccel_sw_pix_fmt = s->avctx->pix_fmt;
+ s->avctx->pix_fmt = s->hwaccel_pix_fmt;
+ }
- if (s->avctx->skip_frame == AVDISCARD_ALL) {
+ if (s->avctx->skip_frame == AVDISCARD_ALL) {
+ s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
+ s->picture_ptr->key_frame = 1;
+ s->got_picture = 1;
+ return 0;
+ }
+
+ av_frame_unref(s->picture_ptr);
+ if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
+ return -1;
s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
s->picture_ptr->key_frame = 1;
s->got_picture = 1;
- return 0;
- }
-
- av_frame_unref(s->picture_ptr);
- if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
- return -1;
- s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
- s->picture_ptr->key_frame = 1;
- s->got_picture = 1;
- for (i = 0; i < 4; i++)
- s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
+ for (i = 0; i < 4; i++)
+ s->linesize[i] = s->picture_ptr->linesize[i] << s->interlaced;
- ff_dlog(s->avctx, "%d %d %d %d %d %d\n",
- s->width, s->height, s->linesize[0], s->linesize[1],
- s->interlaced, s->avctx->height);
+ ff_dlog(s->avctx, "%d %d %d %d %d %d\n",
+ s->width, s->height, s->linesize[0], s->linesize[1],
+ s->interlaced, s->avctx->height);
}
if ((s->rgb && !s->lossless && !s->ls) ||
- (!s->rgb && s->ls && s->nb_components > 1)) {
+ (!s->rgb && s->ls && s->nb_components > 1) ||
+ (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 && !s->ls)
+ ) {
av_log(s->avctx, AV_LOG_ERROR, "Unsupported coding and pixel format combination\n");
return AVERROR_PATCHWELCOME;
}
@@ -2113,7 +2115,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
while (buf_end - buf_ptr > 1) {
v = *buf_ptr++;
v2 = *buf_ptr;
- if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
+ if ((v == 0xff) && (v2 >= SOF0) && (v2 <= COM) && buf_ptr < buf_end) {
val = *buf_ptr++;
goto found;
}
@@ -2178,7 +2180,7 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
src--;
}
- if (x < 0xd0 || x > 0xd7) {
+ if (x < RST0 || x > RST7) {
copy_data_segment(1);
if (x)
break;
@@ -2317,7 +2319,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_log(avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
/* process markers */
- if (start_code >= 0xd0 && start_code <= 0xd7) {
+ if (start_code >= RST0 && start_code <= RST7) {
av_log(avctx, AV_LOG_DEBUG,
"restart marker: %d\n", start_code & 0x0f);
/* APP fields */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parse.c b/chromium/third_party/ffmpeg/libavcodec/mlp_parse.c
new file mode 100644
index 00000000000..067735303c1
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parse.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2007 Ian Caulfield
+ *
+ * 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/channel_layout.h"
+#include "get_bits.h"
+#include "mlp_parse.h"
+#include "mlp.h"
+
+static const uint8_t mlp_quants[16] = {
+ 16, 20, 24, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static const uint8_t mlp_channels[32] = {
+ 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
+ 5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+static const uint64_t mlp_layout[32] = {
+ AV_CH_LAYOUT_MONO,
+ AV_CH_LAYOUT_STEREO,
+ AV_CH_LAYOUT_2_1,
+ AV_CH_LAYOUT_QUAD,
+ AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_SURROUND,
+ AV_CH_LAYOUT_4POINT0,
+ AV_CH_LAYOUT_5POINT0_BACK,
+ AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_5POINT1_BACK,
+ AV_CH_LAYOUT_4POINT0,
+ AV_CH_LAYOUT_5POINT0_BACK,
+ AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_5POINT1_BACK,
+ AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
+ AV_CH_LAYOUT_5POINT0_BACK,
+ AV_CH_LAYOUT_5POINT1_BACK,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+static const uint8_t thd_chancount[13] = {
+// LR C LFE LRs LRvh LRc LRrs Cs Ts LRsd LRw Cvh LFE2
+ 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1
+};
+
+static const uint64_t thd_layout[13] = {
+ AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT, // LR
+ AV_CH_FRONT_CENTER, // C
+ AV_CH_LOW_FREQUENCY, // LFE
+ AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, // LRs
+ AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT, // LRvh
+ AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
+ AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT, // LRrs
+ AV_CH_BACK_CENTER, // Cs
+ AV_CH_TOP_CENTER, // Ts
+ AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
+ AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT, // LRw
+ AV_CH_TOP_FRONT_CENTER, // Cvh
+ AV_CH_LOW_FREQUENCY_2, // LFE2
+};
+
+static int mlp_samplerate(int in)
+{
+ if (in == 0xF)
+ return 0;
+
+ return (in & 8 ? 44100 : 48000) << (in & 7) ;
+}
+
+static int truehd_channels(int chanmap)
+{
+ int channels = 0, i;
+
+ for (i = 0; i < 13; i++)
+ channels += thd_chancount[i] * ((chanmap >> i) & 1);
+
+ return channels;
+}
+
+static uint64_t truehd_layout(int chanmap)
+{
+ int i;
+ uint64_t layout = 0;
+
+ for (i = 0; i < 13; i++)
+ layout |= thd_layout[i] * ((chanmap >> i) & 1);
+
+ return layout;
+}
+
+static int mlp_get_major_sync_size(const uint8_t * buf, int bufsize)
+{
+ int has_extension, extensions = 0;
+ int size = 28;
+ if (bufsize < 28)
+ return -1;
+
+ if (AV_RB32(buf) == 0xf8726fba) {
+ has_extension = buf[25] & 1;
+ if (has_extension) {
+ extensions = buf[26] >> 4;
+ size += 2 + extensions * 2;
+ }
+ }
+ return size;
+}
+
+/** Read a major sync info header - contains high level information about
+ * the stream - sample rate, channel arrangement etc. Most of this
+ * information is not actually necessary for decoding, only for playback.
+ * gb must be a freshly initialized GetBitContext with no bits read.
+ */
+
+int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
+{
+ int ratebits, channel_arrangement, header_size;
+ uint16_t checksum;
+
+ av_assert1(get_bits_count(gb) == 0);
+
+ header_size = mlp_get_major_sync_size(gb->buffer, gb->size_in_bits >> 3);
+ if (header_size < 0 || gb->size_in_bits < header_size << 3) {
+ av_log(log, AV_LOG_ERROR, "packet too short, unable to read major sync\n");
+ return -1;
+ }
+
+ checksum = ff_mlp_checksum16(gb->buffer, header_size - 2);
+ if (checksum != AV_RL16(gb->buffer+header_size-2)) {
+ av_log(log, AV_LOG_ERROR, "major sync info header checksum error\n");
+ return AVERROR_INVALIDDATA;
+ }
+
+ if (get_bits_long(gb, 24) != 0xf8726f) /* Sync words */
+ return AVERROR_INVALIDDATA;
+
+ mh->stream_type = get_bits(gb, 8);
+ mh->header_size = header_size;
+
+ if (mh->stream_type == 0xbb) {
+ mh->group1_bits = mlp_quants[get_bits(gb, 4)];
+ mh->group2_bits = mlp_quants[get_bits(gb, 4)];
+
+ ratebits = get_bits(gb, 4);
+ mh->group1_samplerate = mlp_samplerate(ratebits);
+ mh->group2_samplerate = mlp_samplerate(get_bits(gb, 4));
+
+ skip_bits(gb, 11);
+
+ mh->channel_arrangement=
+ channel_arrangement = get_bits(gb, 5);
+ mh->channels_mlp = mlp_channels[channel_arrangement];
+ mh->channel_layout_mlp = mlp_layout[channel_arrangement];
+ } else if (mh->stream_type == 0xba) {
+ mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
+ mh->group2_bits = 0;
+
+ ratebits = get_bits(gb, 4);
+ mh->group1_samplerate = mlp_samplerate(ratebits);
+ mh->group2_samplerate = 0;
+
+ 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 = truehd_layout(channel_arrangement);
+
+ mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
+
+ channel_arrangement = get_bits(gb, 13);
+ mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
+ mh->channel_layout_thd_stream2 = truehd_layout(channel_arrangement);
+ } else
+ return AVERROR_INVALIDDATA;
+
+ mh->access_unit_size = 40 << (ratebits & 7);
+ mh->access_unit_size_pow2 = 64 << (ratebits & 7);
+
+ skip_bits_long(gb, 48);
+
+ mh->is_vbr = get_bits1(gb);
+
+ mh->peak_bitrate = (get_bits(gb, 15) * mh->group1_samplerate + 8) >> 4;
+
+ mh->num_substreams = get_bits(gb, 4);
+
+ skip_bits_long(gb, 4 + (header_size - 17) * 8);
+
+ return 0;
+}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h b/chromium/third_party/ffmpeg/libavcodec/mlp_parse.h
index c5a28839204..c6025d1a185 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.h
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parse.h
@@ -1,5 +1,4 @@
/*
- * MLP parser prototypes
* Copyright (c) 2007 Ian Caulfield
*
* This file is part of FFmpeg.
@@ -19,13 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/**
- * @file
- * MLP parser prototypes
- */
-
-#ifndef AVCODEC_MLP_PARSER_H
-#define AVCODEC_MLP_PARSER_H
+#ifndef AVCODEC_MLP_PARSE_H
+#define AVCODEC_MLP_PARSE_H
#include "get_bits.h"
@@ -64,8 +58,5 @@ typedef struct MLPHeaderInfo
int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb);
-uint64_t ff_truehd_layout(int chanmap);
-
-extern const uint64_t ff_mlp_layout[32];
-#endif /* AVCODEC_MLP_PARSER_H */
+#endif /* AVCODEC_MLP_PARSE_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
index eb3435b6cba..9a076f6a7f4 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlp_parser.c
@@ -26,203 +26,12 @@
#include <stdint.h>
-#include "libavutil/channel_layout.h"
-#include "libavutil/crc.h"
#include "libavutil/internal.h"
#include "get_bits.h"
#include "parser.h"
-#include "mlp_parser.h"
+#include "mlp_parse.h"
#include "mlp.h"
-static const uint8_t mlp_quants[16] = {
- 16, 20, 24, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const uint8_t mlp_channels[32] = {
- 1, 2, 3, 4, 3, 4, 5, 3, 4, 5, 4, 5, 6, 4, 5, 4,
- 5, 6, 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-const uint64_t ff_mlp_layout[32] = {
- AV_CH_LAYOUT_MONO,
- AV_CH_LAYOUT_STEREO,
- AV_CH_LAYOUT_2_1,
- AV_CH_LAYOUT_QUAD,
- AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_SURROUND,
- AV_CH_LAYOUT_4POINT0,
- AV_CH_LAYOUT_5POINT0_BACK,
- AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_5POINT1_BACK,
- AV_CH_LAYOUT_4POINT0,
- AV_CH_LAYOUT_5POINT0_BACK,
- AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_5POINT1_BACK,
- AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
- AV_CH_LAYOUT_5POINT0_BACK,
- AV_CH_LAYOUT_5POINT1_BACK,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const uint8_t thd_chancount[13] = {
-// LR C LFE LRs LRvh LRc LRrs Cs Ts LRsd LRw Cvh LFE2
- 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1
-};
-
-static const uint64_t thd_layout[13] = {
- AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT, // LR
- AV_CH_FRONT_CENTER, // C
- AV_CH_LOW_FREQUENCY, // LFE
- AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, // LRs
- AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT, // LRvh
- AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
- AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT, // LRrs
- AV_CH_BACK_CENTER, // Cs
- AV_CH_TOP_CENTER, // Ts
- AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
- AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT, // LRw
- AV_CH_TOP_FRONT_CENTER, // Cvh
- AV_CH_LOW_FREQUENCY_2, // LFE2
-};
-
-static int mlp_samplerate(int in)
-{
- if (in == 0xF)
- return 0;
-
- return (in & 8 ? 44100 : 48000) << (in & 7) ;
-}
-
-static int truehd_channels(int chanmap)
-{
- int channels = 0, i;
-
- for (i = 0; i < 13; i++)
- channels += thd_chancount[i] * ((chanmap >> i) & 1);
-
- return channels;
-}
-
-uint64_t ff_truehd_layout(int chanmap)
-{
- int i;
- uint64_t layout = 0;
-
- for (i = 0; i < 13; i++)
- layout |= thd_layout[i] * ((chanmap >> i) & 1);
-
- return layout;
-}
-
-static int mlp_get_major_sync_size(const uint8_t * buf, int bufsize)
-{
- int has_extension, extensions = 0;
- int size = 28;
- if (bufsize < 28)
- return -1;
-
- if (AV_RB32(buf) == 0xf8726fba) {
- has_extension = buf[25] & 1;
- if (has_extension) {
- extensions = buf[26] >> 4;
- size += 2 + extensions * 2;
- }
- }
- return size;
-}
-
-/** Read a major sync info header - contains high level information about
- * the stream - sample rate, channel arrangement etc. Most of this
- * information is not actually necessary for decoding, only for playback.
- * gb must be a freshly initialized GetBitContext with no bits read.
- */
-
-int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
-{
- int ratebits, channel_arrangement, header_size;
- uint16_t checksum;
-
- av_assert1(get_bits_count(gb) == 0);
-
- header_size = mlp_get_major_sync_size(gb->buffer, gb->size_in_bits >> 3);
- if (header_size < 0 || gb->size_in_bits < header_size << 3) {
- av_log(log, AV_LOG_ERROR, "packet too short, unable to read major sync\n");
- return -1;
- }
-
- checksum = ff_mlp_checksum16(gb->buffer, header_size - 2);
- if (checksum != AV_RL16(gb->buffer+header_size-2)) {
- av_log(log, AV_LOG_ERROR, "major sync info header checksum error\n");
- return AVERROR_INVALIDDATA;
- }
-
- if (get_bits_long(gb, 24) != 0xf8726f) /* Sync words */
- return AVERROR_INVALIDDATA;
-
- mh->stream_type = get_bits(gb, 8);
- mh->header_size = header_size;
-
- if (mh->stream_type == 0xbb) {
- mh->group1_bits = mlp_quants[get_bits(gb, 4)];
- mh->group2_bits = mlp_quants[get_bits(gb, 4)];
-
- ratebits = get_bits(gb, 4);
- mh->group1_samplerate = mlp_samplerate(ratebits);
- mh->group2_samplerate = mlp_samplerate(get_bits(gb, 4));
-
- skip_bits(gb, 11);
-
- mh->channel_arrangement=
- channel_arrangement = get_bits(gb, 5);
- mh->channels_mlp = mlp_channels[channel_arrangement];
- mh->channel_layout_mlp = ff_mlp_layout[channel_arrangement];
- } else if (mh->stream_type == 0xba) {
- mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
- mh->group2_bits = 0;
-
- ratebits = get_bits(gb, 4);
- mh->group1_samplerate = mlp_samplerate(ratebits);
- mh->group2_samplerate = 0;
-
- 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);
-
- mh->channel_modifier_thd_stream2 = get_bits(gb, 2);
-
- channel_arrangement = get_bits(gb, 13);
- mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
- mh->channel_layout_thd_stream2 = ff_truehd_layout(channel_arrangement);
- } else
- return AVERROR_INVALIDDATA;
-
- mh->access_unit_size = 40 << (ratebits & 7);
- mh->access_unit_size_pow2 = 64 << (ratebits & 7);
-
- skip_bits_long(gb, 48);
-
- mh->is_vbr = get_bits1(gb);
-
- mh->peak_bitrate = (get_bits(gb, 15) * mh->group1_samplerate + 8) >> 4;
-
- mh->num_substreams = get_bits(gb, 4);
-
- skip_bits_long(gb, 4 + (header_size - 17) * 8);
-
- return 0;
-}
-
typedef struct MLPParseContext
{
ParseContext pc;
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
index 3139a0172fa..39c40914cd8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpdec.c
@@ -34,7 +34,7 @@
#include "internal.h"
#include "libavutil/crc.h"
#include "parser.h"
-#include "mlp_parser.h"
+#include "mlp_parse.h"
#include "mlpdsp.h"
#include "mlp.h"
#include "config.h"
diff --git a/chromium/third_party/ffmpeg/libavcodec/mlpenc.c b/chromium/third_party/ffmpeg/libavcodec/mlpenc.c
index 7536d3b2f50..deb171645cc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mlpenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mlpenc.c
@@ -2232,10 +2232,8 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
return 1;
/* add current frame to queue */
- if (frame) {
- if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0)
- return ret;
- }
+ if ((ret = ff_af_queue_add(&ctx->afq, frame)) < 0)
+ return ret;
data = frame->data[0];
diff --git a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
index a88b837b3ef..73977664a51 100644
--- a/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
+++ b/chromium/third_party/ffmpeg/libavcodec/motionpixels.c
@@ -201,6 +201,8 @@ static int mp_get_vlc(MotionPixelsContext *mp, GetBitContext *gb)
int i;
i = (mp->codes_count == 1) ? 0 : get_vlc2(gb, mp->vlc.table, mp->max_codes_bits, 1);
+ if (i < 0)
+ return i;
return mp->codes[i].delta;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c b/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
index 5878607061e..cd48aa7bb8f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/movsub_bsf.c
@@ -75,8 +75,8 @@ static int mov2textsub(AVBSFContext *ctx, AVPacket *pkt)
return AVERROR_INVALIDDATA;
}
- pkt->data += 2;
pkt->size = FFMIN(pkt->size - 2, AV_RB16(pkt->data));
+ pkt->data += 2;
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mpeg2_metadata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/mpeg2_metadata_bsf.c
index ba3a74afda6..6779ffd4c42 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mpeg2_metadata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mpeg2_metadata_bsf.c
@@ -53,7 +53,7 @@ static int mpeg2_metadata_update_fragment(AVBSFContext *bsf,
MPEG2RawSequenceHeader *sh = NULL;
MPEG2RawSequenceExtension *se = NULL;
MPEG2RawSequenceDisplayExtension *sde = NULL;
- int i, se_pos, add_sde = 0;
+ int i, se_pos;
for (i = 0; i < frag->nb_units; i++) {
if (frag->units[i].type == MPEG2_START_SEQUENCE_HEADER) {
@@ -115,7 +115,7 @@ static int mpeg2_metadata_update_fragment(AVBSFContext *bsf,
ctx->transfer_characteristics >= 0 ||
ctx->matrix_coefficients >= 0) {
if (!sde) {
- add_sde = 1;
+ int err;
ctx->sequence_display_extension.extension_start_code =
MPEG2_START_EXTENSION;
ctx->sequence_display_extension.extension_start_code_identifier =
@@ -135,6 +135,16 @@ static int mpeg2_metadata_update_fragment(AVBSFContext *bsf,
.display_vertical_size =
se->vertical_size_extension << 12 | sh->vertical_size_value,
};
+
+ err = ff_cbs_insert_unit_content(ctx->cbc, frag, se_pos + 1,
+ MPEG2_START_EXTENSION,
+ &ctx->sequence_display_extension,
+ NULL);
+ if (err < 0) {
+ av_log(bsf, AV_LOG_ERROR, "Failed to insert new sequence "
+ "display extension.\n");
+ return err;
+ }
}
if (ctx->video_format >= 0)
@@ -147,50 +157,29 @@ static int mpeg2_metadata_update_fragment(AVBSFContext *bsf,
if (ctx->colour_primaries >= 0)
sde->colour_primaries = ctx->colour_primaries;
- else if (add_sde)
- sde->colour_primaries = 2;
if (ctx->transfer_characteristics >= 0)
sde->transfer_characteristics = ctx->transfer_characteristics;
- else if (add_sde)
- sde->transfer_characteristics = 2;
if (ctx->matrix_coefficients >= 0)
sde->matrix_coefficients = ctx->matrix_coefficients;
- else if (add_sde)
- sde->matrix_coefficients = 2;
- }
- }
-
- if (add_sde) {
- int err;
-
- err = ff_cbs_insert_unit_content(ctx->cbc, frag, se_pos + 1,
- MPEG2_START_EXTENSION,
- &ctx->sequence_display_extension,
- NULL);
- if (err < 0) {
- av_log(bsf, AV_LOG_ERROR, "Failed to insert new sequence "
- "display extension.\n");
- return err;
}
}
return 0;
}
-static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
+static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
{
MPEG2MetadataContext *ctx = bsf->priv_data;
- AVPacket *in = NULL;
CodedBitstreamFragment *frag = &ctx->fragment;
int err;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->cbc, frag, in);
+ err = ff_cbs_read_packet(ctx->cbc, frag, pkt);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
goto fail;
@@ -202,23 +191,18 @@ static int mpeg2_metadata_filter(AVBSFContext *bsf, AVPacket *out)
goto fail;
}
- err = ff_cbs_write_packet(ctx->cbc, out, frag);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, frag);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
err = 0;
fail:
ff_cbs_fragment_reset(ctx->cbc, frag);
if (err < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/mss4.c b/chromium/third_party/ffmpeg/libavcodec/mss4.c
index b58c21be938..76c746a2d52 100644
--- a/chromium/third_party/ffmpeg/libavcodec/mss4.c
+++ b/chromium/third_party/ffmpeg/libavcodec/mss4.c
@@ -552,6 +552,11 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
"Empty frame found but it is not a skip frame.\n");
return AVERROR_INVALIDDATA;
}
+ mb_width = FFALIGN(width, 16) >> 4;
+ mb_height = FFALIGN(height, 16) >> 4;
+
+ if (frame_type != SKIP_FRAME && 8*buf_size < 8*HEADER_SIZE + mb_width*mb_height)
+ return AVERROR_INVALIDDATA;
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
return ret;
@@ -574,9 +579,6 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if ((ret = init_get_bits8(&gb, buf + HEADER_SIZE, buf_size - HEADER_SIZE)) < 0)
return ret;
-
- mb_width = FFALIGN(width, 16) >> 4;
- mb_height = FFALIGN(height, 16) >> 4;
dst[0] = c->pic->data[0];
dst[1] = c->pic->data[1];
dst[2] = c->pic->data[2];
diff --git a/chromium/third_party/ffmpeg/libavcodec/nvenc.c b/chromium/third_party/ffmpeg/libavcodec/nvenc.c
index d3413b3fd72..3fe64bba8bd 100644
--- a/chromium/third_party/ffmpeg/libavcodec/nvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/nvenc.c
@@ -1560,19 +1560,23 @@ static int nvenc_find_free_reg_resource(AVCodecContext *avctx)
NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs;
NVENCSTATUS nv_status;
- int i;
+ int i, first_round;
if (ctx->nb_registered_frames == FF_ARRAY_ELEMS(ctx->registered_frames)) {
- for (i = 0; i < ctx->nb_registered_frames; i++) {
- if (!ctx->registered_frames[i].mapped) {
- if (ctx->registered_frames[i].regptr) {
- nv_status = p_nvenc->nvEncUnregisterResource(ctx->nvencoder, ctx->registered_frames[i].regptr);
- if (nv_status != NV_ENC_SUCCESS)
- return nvenc_print_error(avctx, nv_status, "Failed unregistering unused input resource");
- ctx->registered_frames[i].ptr = NULL;
- ctx->registered_frames[i].regptr = NULL;
+ for (first_round = 1; first_round >= 0; first_round--) {
+ for (i = 0; i < ctx->nb_registered_frames; i++) {
+ if (!ctx->registered_frames[i].mapped) {
+ if (ctx->registered_frames[i].regptr) {
+ if (first_round)
+ continue;
+ nv_status = p_nvenc->nvEncUnregisterResource(ctx->nvencoder, ctx->registered_frames[i].regptr);
+ if (nv_status != NV_ENC_SUCCESS)
+ return nvenc_print_error(avctx, nv_status, "Failed unregistering unused input resource");
+ ctx->registered_frames[i].ptr = NULL;
+ ctx->registered_frames[i].regptr = NULL;
+ }
+ return i;
}
- return i;
}
}
} else {
@@ -1846,13 +1850,6 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
res = nvenc_print_error(avctx, nv_status, "Failed unmapping input resource");
goto error;
}
- nv_status = p_nvenc->nvEncUnregisterResource(ctx->nvencoder, ctx->registered_frames[tmpoutsurf->reg_idx].regptr);
- if (nv_status != NV_ENC_SUCCESS) {
- res = nvenc_print_error(avctx, nv_status, "Failed unregistering input resource");
- goto error;
- }
- ctx->registered_frames[tmpoutsurf->reg_idx].ptr = NULL;
- ctx->registered_frames[tmpoutsurf->reg_idx].regptr = NULL;
} else if (ctx->registered_frames[tmpoutsurf->reg_idx].mapped < 0) {
res = AVERROR_BUG;
goto error;
diff --git a/chromium/third_party/ffmpeg/libavcodec/omx.c b/chromium/third_party/ffmpeg/libavcodec/omx.c
index 466e0be9fe1..a1e5a46a544 100644
--- a/chromium/third_party/ffmpeg/libavcodec/omx.c
+++ b/chromium/third_party/ffmpeg/libavcodec/omx.c
@@ -100,7 +100,7 @@ static av_cold int omx_try_load(OMXContext *s, void *logctx,
if (libname2) {
s->lib2 = dlopen(libname2, RTLD_NOW | RTLD_GLOBAL);
if (!s->lib2) {
- av_log(logctx, AV_LOG_WARNING, "%s not found\n", libname);
+ av_log(logctx, AV_LOG_WARNING, "%s not found\n", libname2);
return AVERROR_ENCODER_NOT_FOUND;
}
s->host_init = dlsym(s->lib2, "bcm_host_init");
diff --git a/chromium/third_party/ffmpeg/libavcodec/options.c b/chromium/third_party/ffmpeg/libavcodec/options.c
index 41b60521cc4..35e8ac93137 100644
--- a/chromium/third_party/ffmpeg/libavcodec/options.c
+++ b/chromium/third_party/ffmpeg/libavcodec/options.c
@@ -347,172 +347,3 @@ const AVClass *avcodec_get_subtitle_rect_class(void)
{
return &av_subtitle_rect_class;
}
-
-#ifdef TEST
-static int dummy_init(AVCodecContext *ctx)
-{
- //TODO: this code should set every possible pointer that could be set by codec and is not an option;
- ctx->extradata_size = 8;
- ctx->extradata = av_malloc(ctx->extradata_size);
- return 0;
-}
-
-static int dummy_close(AVCodecContext *ctx)
-{
- av_freep(&ctx->extradata);
- ctx->extradata_size = 0;
- return 0;
-}
-
-static int dummy_encode(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
-{
- return AVERROR(ENOSYS);
-}
-
-typedef struct Dummy12Context {
- AVClass *av_class;
- int num;
- char* str;
-} Dummy12Context;
-
-typedef struct Dummy3Context {
- void *fake_av_class;
- int num;
- char* str;
-} Dummy3Context;
-
-#define OFFSET(x) offsetof(Dummy12Context, x)
-#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
-static const AVOption dummy_options[] = {
- { "str", "set str", OFFSET(str), AV_OPT_TYPE_STRING, { .str = "i'm src default value" }, 0, 0, VE},
- { "num", "set num", OFFSET(num), AV_OPT_TYPE_INT, { .i64 = 1500100900 }, 0, INT_MAX, VE},
- { NULL },
-};
-
-static const AVClass dummy_v1_class = {
- .class_name = "dummy_v1_class",
- .item_name = av_default_item_name,
- .option = dummy_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-static const AVClass dummy_v2_class = {
- .class_name = "dummy_v2_class",
- .item_name = av_default_item_name,
- .option = dummy_options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
-/* codec with options */
-static AVCodec dummy_v1_encoder = {
- .name = "dummy_v1_codec",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_NONE - 1,
- .encode2 = dummy_encode,
- .init = dummy_init,
- .close = dummy_close,
- .priv_class = &dummy_v1_class,
- .priv_data_size = sizeof(Dummy12Context),
-};
-
-/* codec with options, different class */
-static AVCodec dummy_v2_encoder = {
- .name = "dummy_v2_codec",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_NONE - 2,
- .encode2 = dummy_encode,
- .init = dummy_init,
- .close = dummy_close,
- .priv_class = &dummy_v2_class,
- .priv_data_size = sizeof(Dummy12Context),
-};
-
-/* codec with priv data, but no class */
-static AVCodec dummy_v3_encoder = {
- .name = "dummy_v3_codec",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_NONE - 3,
- .encode2 = dummy_encode,
- .init = dummy_init,
- .close = dummy_close,
- .priv_data_size = sizeof(Dummy3Context),
-};
-
-/* codec without priv data */
-static AVCodec dummy_v4_encoder = {
- .name = "dummy_v4_codec",
- .type = AVMEDIA_TYPE_VIDEO,
- .id = AV_CODEC_ID_NONE - 4,
- .encode2 = dummy_encode,
- .init = dummy_init,
- .close = dummy_close,
-};
-
-static void test_copy_print_codec(const AVCodecContext *ctx)
-{
- printf("%-14s: %dx%d prv: %s",
- ctx->codec ? ctx->codec->name : "NULL",
- ctx->width, ctx->height,
- ctx->priv_data ? "set" : "null");
- if (ctx->codec && ctx->codec->priv_class && ctx->codec->priv_data_size) {
- int64_t i64;
- char *str = NULL;
- av_opt_get_int(ctx->priv_data, "num", 0, &i64);
- av_opt_get(ctx->priv_data, "str", 0, (uint8_t**)&str);
- printf(" opts: %"PRId64" %s", i64, str);
- av_free(str);
- }
- printf("\n");
-}
-
-static void test_copy(const AVCodec *c1, const AVCodec *c2)
-{
- AVCodecContext *ctx1, *ctx2;
- printf("%s -> %s\nclosed:\n", c1 ? c1->name : "NULL", c2 ? c2->name : "NULL");
- ctx1 = avcodec_alloc_context3(c1);
- ctx2 = avcodec_alloc_context3(c2);
- ctx1->width = ctx1->height = 128;
- if (ctx2->codec && ctx2->codec->priv_class && ctx2->codec->priv_data_size) {
- av_opt_set(ctx2->priv_data, "num", "667", 0);
- av_opt_set(ctx2->priv_data, "str", "i'm dest value before copy", 0);
- }
- avcodec_copy_context(ctx2, ctx1);
- test_copy_print_codec(ctx1);
- test_copy_print_codec(ctx2);
- if (ctx1->codec) {
- printf("opened:\n");
- avcodec_open2(ctx1, ctx1->codec, NULL);
- if (ctx2->codec && ctx2->codec->priv_class && ctx2->codec->priv_data_size) {
- av_opt_set(ctx2->priv_data, "num", "667", 0);
- av_opt_set(ctx2->priv_data, "str", "i'm dest value before copy", 0);
- }
- avcodec_copy_context(ctx2, ctx1);
- test_copy_print_codec(ctx1);
- test_copy_print_codec(ctx2);
- avcodec_close(ctx1);
- }
- avcodec_free_context(&ctx1);
- avcodec_free_context(&ctx2);
-}
-
-int main(void)
-{
- AVCodec *dummy_codec[] = {
- &dummy_v1_encoder,
- &dummy_v2_encoder,
- &dummy_v3_encoder,
- &dummy_v4_encoder,
- NULL,
- };
- int i, j;
-
- for (i = 0; dummy_codec[i]; i++)
- avcodec_register(dummy_codec[i]);
-
- printf("testing avcodec_copy_context()\n");
- for (i = 0; i < FF_ARRAY_ELEMS(dummy_codec); i++)
- for (j = 0; j < FF_ARRAY_ELEMS(dummy_codec); j++)
- test_copy(dummy_codec[i], dummy_codec[j]);
- return 0;
-}
-#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/pafvideo.c b/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
index 7c5861dfaf6..323c662c590 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pafvideo.c
@@ -285,13 +285,14 @@ static int paf_video_decode(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
+ if ((code & 0xF) == 0 &&
+ c->video_size / 32 - (int64_t)bytestream2_get_bytes_left(&c->gb) > c->video_size / 32 * (int64_t)avctx->discard_damaged_percentage / 100)
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
return ret;
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->pic->key_frame = 1;
@@ -328,6 +329,10 @@ static int paf_video_decode(AVCodecContext *avctx, void *data,
c->pic->palette_has_changed = 1;
}
+ if (code & 0x20)
+ for (i = 0; i < 4; i++)
+ memset(c->frame[i], 0, c->frame_size);
+
switch (code & 0x0F) {
case 0:
/* Block-based motion compensation using 4x4 blocks with either
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngdec.c b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
index 6a681be29d7..5209e342db5 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngdec.c
@@ -1535,12 +1535,17 @@ static int decode_frame_lscr(AVCodecContext *avctx,
AVFrame *frame = data;
int ret, nb_blocks, offset = 0;
+ if (avpkt->size < 2)
+ return AVERROR_INVALIDDATA;
+
bytestream2_init(gb, avpkt->data, avpkt->size);
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
nb_blocks = bytestream2_get_le16(gb);
+ if (bytestream2_get_bytes_left(gb) < 2 + nb_blocks * 12)
+ return AVERROR_INVALIDDATA;
if (s->last_picture.f->data[0]) {
ret = av_frame_copy(frame, s->last_picture.f);
diff --git a/chromium/third_party/ffmpeg/libavcodec/pngenc.c b/chromium/third_party/ffmpeg/libavcodec/pngenc.c
index 69b44954049..d4d8dc8b5ef 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pngenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pngenc.c
@@ -748,11 +748,11 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
original_bytestream_end = s->bytestream_end;
temp_bytestream = av_malloc(original_bytestream_end - original_bytestream);
- temp_bytestream_end = temp_bytestream + (original_bytestream_end - original_bytestream);
if (!temp_bytestream) {
ret = AVERROR(ENOMEM);
goto fail;
}
+ temp_bytestream_end = temp_bytestream + (original_bytestream_end - original_bytestream);
for (last_fctl_chunk.dispose_op = 0; last_fctl_chunk.dispose_op < 3; ++last_fctl_chunk.dispose_op) {
// 0: APNG_DISPOSE_OP_NONE
diff --git a/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c b/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
index 95241c30b32..5339bebde97 100644
--- a/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
+++ b/chromium/third_party/ffmpeg/libavcodec/pnm_parser.c
@@ -19,24 +19,42 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "parser.h" //for ParseContext
#include "pnm.h"
+typedef struct PNMParseContext {
+ ParseContext pc;
+ int remaining_bytes;
+ int ascii_scan;
+}PNMParseContext;
static int pnm_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
- ParseContext *pc = s->priv_data;
+ PNMParseContext *pnmpc = s->priv_data;
+ ParseContext *pc = &pnmpc->pc;
PNMContext pnmctx;
- int next;
+ int next = END_NOT_FOUND;
int skip = 0;
for (; pc->overread > 0; pc->overread--) {
pc->buffer[pc->index++]= pc->buffer[pc->overread_index++];
}
+
+ if (pnmpc->remaining_bytes) {
+ int inc = FFMIN(pnmpc->remaining_bytes, buf_size);
+ skip += inc;
+ pnmpc->remaining_bytes -= inc;
+
+ if (!pnmpc->remaining_bytes)
+ next = skip;
+ goto end;
+ }
+
retry:
if (pc->index) {
pnmctx.bytestream_start =
@@ -47,11 +65,11 @@ retry:
pnmctx.bytestream = (uint8_t *) buf + skip; /* casts avoid warnings */
pnmctx.bytestream_end = (uint8_t *) buf + buf_size - skip;
}
- next = END_NOT_FOUND;
if (ff_pnm_decode_header(avctx, &pnmctx) < 0) {
if (pnmctx.bytestream < pnmctx.bytestream_end) {
if (pc->index) {
pc->index = 0;
+ pnmpc->ascii_scan = 0;
} else {
unsigned step = FFMAX(1, pnmctx.bytestream - pnmctx.bytestream_start);
@@ -62,26 +80,39 @@ retry:
} else if (pnmctx.type < 4) {
uint8_t *bs = pnmctx.bytestream;
const uint8_t *end = pnmctx.bytestream_end;
+ uint8_t *sync = bs;
+
+ if (pc->index) {
+ av_assert0(pnmpc->ascii_scan <= end - bs);
+ bs += pnmpc->ascii_scan;
+ }
while (bs < end) {
- int c = *bs++;
+ int c;
+ sync = bs;
+ c = *bs++;
if (c == '#') {
while (c != '\n' && bs < end)
c = *bs++;
} else if (c == 'P') {
next = bs - pnmctx.bytestream_start + skip - 1;
+ pnmpc->ascii_scan = 0;
break;
}
}
+ if (next == END_NOT_FOUND)
+ pnmpc->ascii_scan = sync - pnmctx.bytestream + skip;
} else {
next = pnmctx.bytestream - pnmctx.bytestream_start + skip
+ av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1);
}
if (next != END_NOT_FOUND && pnmctx.bytestream_start != buf + skip)
next -= pc->index;
- if (next > buf_size)
+ if (next > buf_size) {
+ pnmpc->remaining_bytes = next - buf_size;
next = END_NOT_FOUND;
-
+ }
+end:
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
@@ -95,7 +126,7 @@ retry:
AVCodecParser ff_pnm_parser = {
.codec_ids = { AV_CODEC_ID_PGM, AV_CODEC_ID_PGMYUV, AV_CODEC_ID_PPM,
AV_CODEC_ID_PBM, AV_CODEC_ID_PAM },
- .priv_data_size = sizeof(ParseContext),
+ .priv_data_size = sizeof(PNMParseContext),
.parser_parse = pnm_parse,
.parser_close = ff_parse_close,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/prosumer.c b/chromium/third_party/ffmpeg/libavcodec/prosumer.c
index f064f7bad77..9950519604c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/prosumer.c
+++ b/chromium/third_party/ffmpeg/libavcodec/prosumer.c
@@ -153,7 +153,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (avpkt->size <= 32)
return AVERROR_INVALIDDATA;
- memset(s->decbuffer, 0, s->size);
bytestream2_init(&s->gb, avpkt->data, avpkt->size);
bytestream2_init_writer(&s->pb, s->decbuffer, s->size);
ret = decompress(&s->gb, AV_RL32(avpkt->data + 28) >> 1, &s->pb, s->lut);
@@ -161,6 +160,10 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return ret;
if (bytestream2_get_bytes_left_p(&s->pb) > s->size * (int64_t)avctx->discard_damaged_percentage / 100)
return AVERROR_INVALIDDATA;
+
+ av_assert0(s->size >= bytestream2_get_bytes_left_p(&s->pb));
+ memset(s->decbuffer + bytestream2_tell_p(&s->pb), 0, bytestream2_get_bytes_left_p(&s->pb));
+
vertical_predict((uint32_t *)s->decbuffer, 0, (uint32_t *)s->initial_line, s->stride, 1);
vertical_predict((uint32_t *)s->decbuffer, s->stride, (uint32_t *)s->decbuffer, s->stride, avctx->height - 1);
diff --git a/chromium/third_party/ffmpeg/libavcodec/qdm2.c b/chromium/third_party/ffmpeg/libavcodec/qdm2.c
index 88b6b19d112..eaffb36dcc0 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qdm2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qdm2.c
@@ -408,7 +408,12 @@ static int fix_coding_method_array(int sb, int channels,
}
for (k = 0; k < run; k++) {
if (j + k < 128) {
- if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j]) {
+ int sbjk = sb + (j + k) / 64;
+ if (sbjk > 29) {
+ SAMPLES_NEEDED
+ continue;
+ }
+ if (coding_method[ch][sbjk][(j + k) % 64] > coding_method[ch][sb][j]) {
if (k > 0) {
SAMPLES_NEEDED
//not debugged, almost never used
@@ -1284,6 +1289,10 @@ static void qdm2_fft_decode_tones(QDM2Context *q, int duration,
}
offset += (n - 2);
} else {
+ if (local_int_10 <= 2) {
+ av_log(NULL, AV_LOG_ERROR, "qdm2_fft_decode_tones() stuck\n");
+ return;
+ }
offset += qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2);
while (offset >= (local_int_10 - 1)) {
offset += (1 - (local_int_10 - 1));
@@ -1695,13 +1704,19 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
s->group_size = bytestream2_get_be32(&gb);
s->fft_size = bytestream2_get_be32(&gb);
s->checksum_size = bytestream2_get_be32(&gb);
- if (s->checksum_size >= 1U << 28) {
- av_log(avctx, AV_LOG_ERROR, "data block size too large (%u)\n", s->checksum_size);
+ if (s->checksum_size >= 1U << 28 || !s->checksum_size) {
+ av_log(avctx, AV_LOG_ERROR, "data block size invalid (%u)\n", s->checksum_size);
return AVERROR_INVALIDDATA;
}
s->fft_order = av_log2(s->fft_size) + 1;
+ // Fail on unknown fft order
+ if ((s->fft_order < 7) || (s->fft_order > 9)) {
+ avpriv_request_sample(avctx, "Unknown FFT order %d", s->fft_order);
+ return AVERROR_PATCHWELCOME;
+ }
+
// something like max decodable tones
s->group_order = av_log2(s->group_size) + 1;
s->frame_size = s->group_size / 16; // 16 iterations per super block
@@ -1735,11 +1750,6 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
else
s->coeff_per_sb_select = 2;
- // Fail on unknown fft order
- if ((s->fft_order < 7) || (s->fft_order > 9)) {
- avpriv_request_sample(avctx, "Unknown FFT order %d", s->fft_order);
- return AVERROR_PATCHWELCOME;
- }
if (s->fft_size != (1 << (s->fft_order - 1))) {
av_log(avctx, AV_LOG_ERROR, "FFT size %d not power of 2.\n", s->fft_size);
return AVERROR_INVALIDDATA;
diff --git a/chromium/third_party/ffmpeg/libavcodec/qdmc.c b/chromium/third_party/ffmpeg/libavcodec/qdmc.c
index 8f5b7b920d2..8bea1552e12 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qdmc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qdmc.c
@@ -577,9 +577,9 @@ static void add_noise(QDMCContext *s, int ch, int current_subframe)
for (j = 2; j < s->subframe_size - 1; j++) {
float rnd_re, rnd_im;
- s->rndval = 214013 * s->rndval + 2531011;
+ s->rndval = 214013U * s->rndval + 2531011;
rnd_im = ((s->rndval & 0x7FFF) - 16384.0f) * 0.000030517578f * s->noise2_buffer[j];
- s->rndval = 214013 * s->rndval + 2531011;
+ s->rndval = 214013U * s->rndval + 2531011;
rnd_re = ((s->rndval & 0x7FFF) - 16384.0f) * 0.000030517578f * s->noise2_buffer[j];
im[j ] += rnd_im;
re[j ] += rnd_re;
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsv.c b/chromium/third_party/ffmpeg/libavcodec/qsv.c
index bb0d79588c4..986d4f6022c 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsv.c
@@ -67,20 +67,69 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
return AVERROR(ENOSYS);
}
+
+static const struct {
+ enum AVCodecID codec_id;
+ int codec_profile;
+ int mfx_profile;
+} qsv_profile_map[] = {
+#define MAP(c, p, v) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, MFX_PROFILE_ ## v }
+ MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2_SIMPLE ),
+ MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2_MAIN ),
+ MAP(MPEG2VIDEO, MPEG2_HIGH, MPEG2_HIGH ),
+
+ MAP(H264, H264_BASELINE, AVC_BASELINE ),
+ MAP(H264, H264_CONSTRAINED_BASELINE, AVC_BASELINE),
+#if QSV_VERSION_ATLEAST(1, 3)
+ MAP(H264, H264_EXTENDED, AVC_EXTENDED ),
+#endif
+ MAP(H264, H264_MAIN, AVC_MAIN ),
+ MAP(H264, H264_HIGH, AVC_HIGH ),
+ MAP(H264, H264_HIGH_422, AVC_HIGH_422 ),
+
+#if QSV_VERSION_ATLEAST(1, 8)
+ MAP(HEVC, HEVC_MAIN, HEVC_MAIN ),
+ MAP(HEVC, HEVC_MAIN_10, HEVC_MAIN10 ),
+ MAP(HEVC, HEVC_MAIN_STILL_PICTURE, HEVC_MAINSP ),
+#endif
+#if QSV_VERSION_ATLEAST(1, 16)
+ MAP(HEVC, HEVC_REXT, HEVC_REXT ),
+#endif
+
+ MAP(VC1, VC1_SIMPLE, VC1_SIMPLE ),
+ MAP(VC1, VC1_MAIN, VC1_MAIN ),
+ MAP(VC1, VC1_COMPLEX, VC1_ADVANCED ),
+ MAP(VC1, VC1_ADVANCED, VC1_ADVANCED ),
+#undef MAP
+};
+
int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile)
{
+ int i;
if (profile == FF_PROFILE_UNKNOWN)
return MFX_PROFILE_UNKNOWN;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(qsv_profile_map); i++) {
+ if (qsv_profile_map[i].codec_id != codec_id)
+ continue;
+ if (qsv_profile_map[i].codec_profile == profile)
+ return qsv_profile_map[i].mfx_profile;
+ }
+
+ return MFX_PROFILE_UNKNOWN;
+}
+
+int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level)
+{
+ if (level == FF_LEVEL_UNKNOWN)
+ return MFX_LEVEL_UNKNOWN;
+
switch (codec_id) {
- case AV_CODEC_ID_H264:
case AV_CODEC_ID_HEVC:
- return profile;
- case AV_CODEC_ID_VC1:
- return 4 * profile + 1;
- case AV_CODEC_ID_MPEG2VIDEO:
- return 0x10 * profile;
+ return level / 3;
+ default:
+ return level;
}
- return MFX_PROFILE_UNKNOWN;
}
static const struct {
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h b/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
index 57d861d2be0..b63a7d6a31e 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/qsv_internal.h
@@ -90,6 +90,7 @@ int ff_qsv_print_warning(void *log_ctx, mfxStatus err,
int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id);
int ff_qsv_profile_to_mfx(enum AVCodecID codec_id, int profile);
+int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level);
int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc);
enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type);
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvdec.c b/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
index 4a0be811fb9..46aa2d68147 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvdec.c
@@ -120,6 +120,33 @@ static inline unsigned int qsv_fifo_size(const AVFifoBuffer* fifo)
return av_fifo_size(fifo) / qsv_fifo_item_size();
}
+static int check_dec_param(AVCodecContext *avctx, QSVContext *q, mfxVideoParam *param_in)
+{
+ mfxVideoParam param_out = { .mfx.CodecId = param_in->mfx.CodecId };
+ mfxStatus ret;
+
+#define CHECK_MATCH(x) \
+ do { \
+ if (param_out.mfx.x != param_in->mfx.x) { \
+ av_log(avctx, AV_LOG_WARNING, "Required "#x" %d is unsupported\n", \
+ param_in->mfx.x); \
+ } \
+ } while (0)
+
+ ret = MFXVideoDECODE_Query(q->session, param_in, &param_out);
+
+ if (ret < 0) {
+ CHECK_MATCH(CodecId);
+ CHECK_MATCH(CodecProfile);
+ CHECK_MATCH(CodecLevel);
+ CHECK_MATCH(FrameInfo.Width);
+ CHECK_MATCH(FrameInfo.Height);
+#undef CHECK_MATCH
+ return 0;
+ }
+ return 1;
+}
+
static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
{
const AVPixFmtDescriptor *desc;
@@ -176,7 +203,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
param.mfx.CodecId = ret;
param.mfx.CodecProfile = ff_qsv_profile_to_mfx(avctx->codec_id, avctx->profile);
- param.mfx.CodecLevel = avctx->level == FF_LEVEL_UNKNOWN ? MFX_LEVEL_UNKNOWN : avctx->level;
+ param.mfx.CodecLevel = ff_qsv_level_to_mfx(avctx->codec_id, avctx->level);
param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
@@ -206,6 +233,12 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
param.ExtParam = q->ext_buffers;
param.NumExtParam = q->nb_ext_buffers;
+ if (!check_dec_param(avctx, q, &param)) {
+ //Just give a warning instead of an error since it is still decodable possibly.
+ av_log(avctx, AV_LOG_WARNING,
+ "Current input bitstream is not supported by QSV decoder.\n");
+ }
+
ret = MFXVideoDECODE_Init(q->session, &param);
if (ret < 0)
return ff_qsv_print_error(avctx, ret,
diff --git a/chromium/third_party/ffmpeg/libavcodec/qsvenc.c b/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
index a03ab69590e..9bf8574e303 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qsvenc.c
@@ -577,7 +577,7 @@ static int init_video_param(AVCodecContext *avctx, QSVEncContext *q)
//libmfx BRC parameters are 16 bits thus maybe overflow, then BRCParamMultiplier is needed
buffer_size_in_kilobytes = avctx->rc_buffer_size / 8000;
- initial_delay_in_kilobytes = avctx->rc_initial_buffer_occupancy / 1000;
+ initial_delay_in_kilobytes = avctx->rc_initial_buffer_occupancy / 8000;
target_bitrate_kbps = avctx->bit_rate / 1000;
max_bitrate_kbps = avctx->rc_max_rate / 1000;
brc_param_multiplier = (FFMAX(FFMAX3(target_bitrate_kbps, max_bitrate_kbps, buffer_size_in_kilobytes),
@@ -1307,7 +1307,6 @@ static int encode_frame(AVCodecContext *avctx, QSVEncContext *q,
if (qsv_frame) {
surf = &qsv_frame->surface;
enc_ctrl = &qsv_frame->enc_ctrl;
- memset(enc_ctrl, 0, sizeof(mfxEncodeCtrl));
if (frame->pict_type == AV_PICTURE_TYPE_I) {
enc_ctrl->FrameType = MFX_FRAMETYPE_I | MFX_FRAMETYPE_REF;
diff --git a/chromium/third_party/ffmpeg/libavcodec/qtrle.c b/chromium/third_party/ffmpeg/libavcodec/qtrle.c
index 1613530e02d..2c29547e5ae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/qtrle.c
+++ b/chromium/third_party/ffmpeg/libavcodec/qtrle.c
@@ -452,7 +452,7 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
int header, start_line;
int height, row_ptr;
int has_palette = 0;
- int ret;
+ int ret, size;
bytestream2_init(&s->g, avpkt->data, avpkt->size);
@@ -461,7 +461,10 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
return avpkt->size;
/* start after the chunk size */
- bytestream2_seek(&s->g, 4, SEEK_SET);
+ size = bytestream2_get_be32(&s->g) & 0x3FFFFFFF;
+ if (size - avpkt->size > size * (int64_t)avctx->discard_damaged_percentage / 100)
+ return AVERROR_INVALIDDATA;
+
/* fetch the header */
header = bytestream2_get_be16(&s->g);
diff --git a/chromium/third_party/ffmpeg/libavcodec/rv10.c b/chromium/third_party/ffmpeg/libavcodec/rv10.c
index 595e2175190..729e4a8d2c7 100644
--- a/chromium/third_party/ffmpeg/libavcodec/rv10.c
+++ b/chromium/third_party/ffmpeg/libavcodec/rv10.c
@@ -388,9 +388,9 @@ static int rv20_decode_picture_header(RVDecContext *rv)
// attempt to keep aspect during typical resolution switches
if (!old_aspect.num)
old_aspect = (AVRational){1, 1};
- if (2 * new_w * s->height == new_h * s->width)
+ if (2 * (int64_t)new_w * s->height == (int64_t)new_h * s->width)
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){2, 1});
- if (new_w * s->height == 2 * new_h * s->width)
+ if ((int64_t)new_w * s->height == 2 * (int64_t)new_h * s->width)
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){1, 2});
ret = ff_set_dimensions(s->avctx, new_w, new_h);
@@ -646,7 +646,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
// Repeat the slice end check from ff_h263_decode_mb with our active
// bitstream size
- if (ret != SLICE_ERROR) {
+ if (ret != SLICE_ERROR && active_bits_size >= get_bits_count(&s->gb)) {
int v = show_bits(&s->gb, 16);
if (get_bits_count(&s->gb) + 16 > active_bits_size)
diff --git a/chromium/third_party/ffmpeg/libavcodec/sanm.c b/chromium/third_party/ffmpeg/libavcodec/sanm.c
index 811fd2188e2..25aee7220fa 100644
--- a/chromium/third_party/ffmpeg/libavcodec/sanm.c
+++ b/chromium/third_party/ffmpeg/libavcodec/sanm.c
@@ -1358,8 +1358,10 @@ static int read_frame_header(SANMVideoContext *ctx, SANMFrameHeader *hdr)
static void fill_frame(uint16_t *pbuf, int buf_size, uint16_t color)
{
- while (buf_size--)
+ if (buf_size--) {
*pbuf++ = color;
+ av_memcpy_backptr((uint8_t*)pbuf, 2, 2*buf_size);
+ }
}
static int copy_output(SANMVideoContext *ctx, SANMFrameHeader *hdr)
diff --git a/chromium/third_party/ffmpeg/libavcodec/scpr.c b/chromium/third_party/ffmpeg/libavcodec/scpr.c
index e5d7d13cf05..317950dafbf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/scpr.c
+++ b/chromium/third_party/ffmpeg/libavcodec/scpr.c
@@ -359,7 +359,7 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
ret = decode_run_i(avctx, ptype, run, &x, &y, clr,
dst, linesize, &lx, &ly,
backstep, off, &cx, &cx1);
- if (run < 0)
+ if (ret < 0)
return ret;
}
@@ -382,8 +382,11 @@ static int decompress_p(AVCodecContext *avctx,
ret = decode_value(s, s->range_model, 256, 1, &min);
ret |= decode_value(s, s->range_model, 256, 1, &temp);
+ if (ret < 0)
+ return ret;
+
min += temp << 8;
- ret |= decode_value(s, s->range_model, 256, 1, &max);
+ ret = decode_value(s, s->range_model, 256, 1, &max);
ret |= decode_value(s, s->range_model, 256, 1, &temp);
if (ret < 0)
return ret;
@@ -572,6 +575,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (ret < 0)
return ret;
+ if (bytestream2_get_bytes_left(gb) > 5)
+ return AVERROR_INVALIDDATA;
+
if (avctx->bits_per_coded_sample != 16) {
ret = av_frame_ref(data, s->current_frame);
if (ret < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/scpr3.c b/chromium/third_party/ffmpeg/libavcodec/scpr3.c
index f92ccfa9026..b4d2e21a179 100644
--- a/chromium/third_party/ffmpeg/libavcodec/scpr3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/scpr3.c
@@ -1007,7 +1007,7 @@ static int decompress_i3(AVCodecContext *avctx, uint32_t *dst, int linesize)
ret = decode_run_i(avctx, ptype, run, &x, &y, clr,
dst, linesize, &lx, &ly,
backstep, off, &cx, &cx1);
- if (run < 0)
+ if (ret < 0)
return ret;
}
@@ -1038,6 +1038,9 @@ static int decompress_p3(AVCodecContext *avctx,
s->range_model3.freqs[1],
s->range_model3.cnts,
s->range_model3.dectab, &temp);
+ if (ret < 0)
+ return ret;
+
min += temp << 8;
ret |= decode_value3(s, 255, &s->range_model3.cntsum,
s->range_model3.freqs[0],
diff --git a/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c b/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
index 35c31321c6f..d8fcfd7c53f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/simple_idct_template.c
@@ -288,42 +288,42 @@ static inline void FUNC6(idctSparseColPut)(pixel *dest, ptrdiff_t line_size,
static inline void FUNC6(idctSparseColAdd)(pixel *dest, ptrdiff_t line_size,
idctin *col)
{
- int a0, a1, a2, a3, b0, b1, b2, b3;
+ unsigned a0, a1, a2, a3, b0, b1, b2, b3;
IDCT_COLS;
- dest[0] = av_clip_pixel(dest[0] + ((a0 + b0) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a0 + b0) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a1 + b1) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a1 + b1) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a2 + b2) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a2 + b2) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a3 + b3) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a3 + b3) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a3 - b3) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a3 - b3) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a2 - b2) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a2 - b2) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a1 - b1) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a1 - b1) >> COL_SHIFT));
dest += line_size;
- dest[0] = av_clip_pixel(dest[0] + ((a0 - b0) >> COL_SHIFT));
+ dest[0] = av_clip_pixel(dest[0] + ((int)(a0 - b0) >> COL_SHIFT));
}
static inline void FUNC6(idctSparseCol)(idctin *col)
#endif
{
- int a0, a1, a2, a3, b0, b1, b2, b3;
+ unsigned a0, a1, a2, a3, b0, b1, b2, b3;
IDCT_COLS;
- col[0 ] = ((a0 + b0) >> COL_SHIFT);
- col[8 ] = ((a1 + b1) >> COL_SHIFT);
- col[16] = ((a2 + b2) >> COL_SHIFT);
- col[24] = ((a3 + b3) >> COL_SHIFT);
- col[32] = ((a3 - b3) >> COL_SHIFT);
- col[40] = ((a2 - b2) >> COL_SHIFT);
- col[48] = ((a1 - b1) >> COL_SHIFT);
- col[56] = ((a0 - b0) >> COL_SHIFT);
+ col[0 ] = ((int)(a0 + b0) >> COL_SHIFT);
+ col[8 ] = ((int)(a1 + b1) >> COL_SHIFT);
+ col[16] = ((int)(a2 + b2) >> COL_SHIFT);
+ col[24] = ((int)(a3 + b3) >> COL_SHIFT);
+ col[32] = ((int)(a3 - b3) >> COL_SHIFT);
+ col[40] = ((int)(a2 - b2) >> COL_SHIFT);
+ col[48] = ((int)(a1 - b1) >> COL_SHIFT);
+ col[56] = ((int)(a0 - b0) >> COL_SHIFT);
}
#ifndef EXTRA_SHIFT
diff --git a/chromium/third_party/ffmpeg/libavcodec/svq3.c b/chromium/third_party/ffmpeg/libavcodec/svq3.c
index 18a4448ffa7..9cea9ac840f 100644
--- a/chromium/third_party/ffmpeg/libavcodec/svq3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/svq3.c
@@ -1183,6 +1183,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
GetBitContext gb;
int frame_size_code;
int unk0, unk1, unk2, unk3, unk4;
+ int w,h;
size = AV_RB32(&extradata[4]);
if (size > extradata_end - extradata - 8) {
@@ -1195,38 +1196,41 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
frame_size_code = get_bits(&gb, 3);
switch (frame_size_code) {
case 0:
- avctx->width = 160;
- avctx->height = 120;
+ w = 160;
+ h = 120;
break;
case 1:
- avctx->width = 128;
- avctx->height = 96;
+ w = 128;
+ h = 96;
break;
case 2:
- avctx->width = 176;
- avctx->height = 144;
+ w = 176;
+ h = 144;
break;
case 3:
- avctx->width = 352;
- avctx->height = 288;
+ w = 352;
+ h = 288;
break;
case 4:
- avctx->width = 704;
- avctx->height = 576;
+ w = 704;
+ h = 576;
break;
case 5:
- avctx->width = 240;
- avctx->height = 180;
+ w = 240;
+ h = 180;
break;
case 6:
- avctx->width = 320;
- avctx->height = 240;
+ w = 320;
+ h = 240;
break;
case 7:
- avctx->width = get_bits(&gb, 12);
- avctx->height = get_bits(&gb, 12);
+ w = get_bits(&gb, 12);
+ h = get_bits(&gb, 12);
break;
}
+ ret = ff_set_dimensions(avctx, w, h);
+ if (ret < 0)
+ goto fail;
s->halfpel_flag = get_bits1(&gb);
s->thirdpel_flag = get_bits1(&gb);
diff --git a/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h b/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
index 3004be3f9c8..b3ff36562b6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tableprint_vlc.h
@@ -36,6 +36,7 @@
#define AVCODEC_AVCODEC_H
#define AVCODEC_INTERNAL_H
#define AV_INPUT_BUFFER_PADDING_SIZE 64 // the value does not matter for this
+#define avpriv_request_sample(...)
#include "tableprint.h"
#include "get_bits.h"
#include "mathtables.c"
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff.c b/chromium/third_party/ffmpeg/libavcodec/tiff.c
index 79e62425496..c520d7df835 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff.c
@@ -56,7 +56,9 @@ typedef struct TiffContext {
int get_subimage;
uint16_t get_page;
+ int get_thumbnail;
+ enum TiffType tiff_type;
int width, height;
unsigned int bpp, bppcount;
uint32_t palette[256];
@@ -70,6 +72,7 @@ typedef struct TiffContext {
int predictor;
int fill_order;
uint32_t res[4];
+ int is_thumbnail;
int is_bayer;
uint8_t pattern[4];
@@ -94,6 +97,11 @@ typedef struct TiffContext {
TiffGeoTag *geotags;
} TiffContext;
+static void tiff_set_type(TiffContext *s, enum TiffType tiff_type) {
+ if (s->tiff_type < tiff_type) // Prioritize higher-valued entries
+ s->tiff_type = tiff_type;
+}
+
static void free_geotags(TiffContext *const s)
{
int i;
@@ -948,6 +956,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
}
switch (tag) {
+ case TIFF_SUBFILE:
+ s->is_thumbnail = (value != 0);
case TIFF_WIDTH:
s->width = value;
break;
@@ -1086,9 +1096,12 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
s->predictor = value;
break;
case TIFF_SUB_IFDS:
- s->sub_ifd = value;
+ if (count == 1)
+ s->sub_ifd = value;
+ else if (count > 1)
+ s->sub_ifd = ff_tget(&s->gb, TIFF_LONG, s->le); /** Only get the first SubIFD */
break;
- case TIFF_WHITE_LEVEL:
+ case DNG_WHITE_LEVEL:
s->white_level = value;
break;
case TIFF_CFA_PATTERN_DIM:
@@ -1339,6 +1352,27 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
case TIFF_SOFTWARE_NAME:
ADD_METADATA(count, "software", NULL);
break;
+ case DNG_VERSION:
+ if (count == 4) {
+ unsigned int ver[4];
+ ver[0] = ff_tget(&s->gb, type, s->le);
+ ver[1] = ff_tget(&s->gb, type, s->le);
+ ver[2] = ff_tget(&s->gb, type, s->le);
+ ver[3] = ff_tget(&s->gb, type, s->le);
+
+ av_log(s->avctx, AV_LOG_DEBUG, "DNG file, version %u.%u.%u.%u\n",
+ ver[0], ver[1], ver[2], ver[3]);
+
+ tiff_set_type(s, TIFF_TYPE_DNG);
+ }
+ break;
+ case CINEMADNG_TIME_CODES:
+ case CINEMADNG_FRAME_RATE:
+ case CINEMADNG_T_STOP:
+ case CINEMADNG_REEL_NAME:
+ case CINEMADNG_CAMERA_LABEL:
+ tiff_set_type(s, TIFF_TYPE_CINEMADNG);
+ break;
default:
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
av_log(s->avctx, AV_LOG_ERROR,
@@ -1387,6 +1421,7 @@ static int decode_frame(AVCodecContext *avctx,
s->le = le;
// TIFF_BPP is not a required tag and defaults to 1
again:
+ s->is_thumbnail = 0;
s->bppcount = s->bpp = 1;
s->photometric = TIFF_PHOTOMETRIC_NONE;
s->compr = TIFF_RAW;
@@ -1394,6 +1429,7 @@ again:
s->white_level = 0;
s->is_bayer = 0;
s->cur_page = 0;
+ s->tiff_type = TIFF_TYPE_TIFF;
free_geotags(s);
// Reset these offsets so we can tell if they were set this frame
@@ -1408,9 +1444,14 @@ again:
return ret;
}
- /** whether we should look for this IFD's SubIFD */
- retry_for_subifd = s->sub_ifd && s->get_subimage;
- /** whether we should look for this multi-page IFD's next page */
+ if (s->get_thumbnail && !s->is_thumbnail) {
+ av_log(avctx, AV_LOG_INFO, "No embedded thumbnail present\n");
+ return AVERROR_EOF;
+ }
+
+ /** whether we should process this IFD's SubIFD */
+ retry_for_subifd = s->sub_ifd && (s->get_subimage || (!s->get_thumbnail && s->is_thumbnail));
+ /** whether we should process this multi-page IFD's next page */
retry_for_page = s->get_page && s->cur_page + 1 < s->get_page; // get_page is 1-indexed
if (retry_for_page) {
@@ -1670,6 +1711,7 @@ static av_cold int tiff_end(AVCodecContext *avctx)
#define OFFSET(x) offsetof(TiffContext, x)
static const AVOption tiff_options[] = {
{ "subimage", "decode subimage instead if available", OFFSET(get_subimage), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
+ { "thumbnail", "decode embedded thumbnail subimage instead if available", OFFSET(get_thumbnail), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
{ "page", "page number of multi-page image to decode (starting from 1)", OFFSET(get_page), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/tiff.h b/chromium/third_party/ffmpeg/libavcodec/tiff.h
index 4b086501088..81913c6b1ae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tiff.h
+++ b/chromium/third_party/ffmpeg/libavcodec/tiff.h
@@ -20,7 +20,7 @@
/**
* @file
- * TIFF tables
+ * TIFF constants & data structures
*
* For more information about the TIFF format, check the official docs at:
* http://partners.adobe.com/public/developer/tiff/index.html
@@ -33,7 +33,17 @@
#include <stdint.h>
#include "tiff_common.h"
-/** abridged list of TIFF tags */
+/** TIFF types in ascenting priority (last in the list is highest) */
+enum TiffType {
+ /** TIFF image based on the TIFF 6.0 or TIFF/EP (ISO 12234-2) specifications */
+ TIFF_TYPE_TIFF,
+ /** Digital Negative (DNG) image */
+ TIFF_TYPE_DNG,
+ /** Digital Negative (DNG) image part of an CinemaDNG image sequence */
+ TIFF_TYPE_CINEMADNG,
+};
+
+/** abridged list of TIFF and TIFF/EP tags */
enum TiffTags {
TIFF_SUBFILE = 0xfe,
TIFF_WIDTH = 0x100,
@@ -85,10 +95,25 @@ enum TiffTags {
TIFF_GEO_KEY_DIRECTORY = 0x87AF,
TIFF_GEO_DOUBLE_PARAMS = 0x87B0,
TIFF_GEO_ASCII_PARAMS = 0x87B1,
- TIFF_WHITE_LEVEL = 0xC61D,
};
-/** list of TIFF compression types */
+/** abridged list of DNG tags */
+enum DngTags {
+ DNG_VERSION = 0xC612,
+ DNG_BACKWARD_VERSION = 0xC613,
+ DNG_WHITE_LEVEL = 0xC61D,
+};
+
+/** list of CinemaDNG tags */
+enum CinemaDngTags {
+ CINEMADNG_TIME_CODES = 0xC763,
+ CINEMADNG_FRAME_RATE = 0xC764,
+ CINEMADNG_T_STOP = 0xC772,
+ CINEMADNG_REEL_NAME = 0xC789,
+ CINEMADNG_CAMERA_LABEL = 0xC7A1,
+};
+
+/** list of TIFF, TIFF/EP and DNG compression types */
enum TiffCompr {
TIFF_RAW = 1,
TIFF_CCITT_RLE,
@@ -151,6 +176,7 @@ enum TiffGeoTagKey {
TIFF_VERTICAL_UNITS_GEOKEY = 4099
};
+/** list of TIFF, TIFF/AP and DNG PhotometricInterpretation (TIFF_PHOTOMETRIC) values */
enum TiffPhotometric {
TIFF_PHOTOMETRIC_NONE = -1,
TIFF_PHOTOMETRIC_WHITE_IS_ZERO, /* mono or grayscale, 0 is white */
@@ -163,7 +189,7 @@ enum TiffPhotometric {
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_CFA = 32803, /* Color Filter Array (TIFF/AP and 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) */
diff --git a/chromium/third_party/ffmpeg/libavcodec/truehd_core_bsf.c b/chromium/third_party/ffmpeg/libavcodec/truehd_core_bsf.c
index dd40e1e0c39..dbd05b34cae 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truehd_core_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truehd_core_bsf.c
@@ -21,7 +21,7 @@
#include "avcodec.h"
#include "bsf.h"
#include "get_bits.h"
-#include "mlp_parser.h"
+#include "mlp_parse.h"
#include "mlp.h"
typedef struct AccessUnit {
@@ -36,97 +36,93 @@ typedef struct TrueHDCoreContext {
MLPHeaderInfo hdr;
} TrueHDCoreContext;
-static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out)
+static int truehd_core_filter(AVBSFContext *ctx, AVPacket *pkt)
{
TrueHDCoreContext *s = ctx->priv_data;
GetBitContext gbc;
AccessUnit units[MAX_SUBSTREAMS];
- AVPacket *in;
- int ret, i, size, last_offset = 0;
+ int ret, i, last_offset = 0;
int in_size, out_size;
int have_header = 0;
- int substream_bits = 0;
- int start, end;
- uint16_t dts;
+ int substream_bytes = 0;
+ int end;
- ret = ff_bsf_get_packet(ctx, &in);
+ ret = ff_bsf_get_packet_ref(ctx, pkt);
if (ret < 0)
return ret;
- if (in->size < 4)
- goto fail;
-
- ret = init_get_bits(&gbc, in->data, 32);
- if (ret < 0)
+ if (pkt->size < 4) {
+ ret = AVERROR_INVALIDDATA;
goto fail;
+ }
- skip_bits(&gbc, 4);
- in_size = get_bits(&gbc, 12) * 2;
- if (in_size < 4 || in_size > in->size)
+ in_size = (AV_RB16(pkt->data) & 0xFFF) * 2;
+ if (in_size < 4 || in_size > pkt->size) {
+ ret = AVERROR_INVALIDDATA;
goto fail;
+ }
- out_size = in_size;
- dts = get_bits(&gbc, 16);
-
- ret = init_get_bits8(&gbc, in->data + 4, in->size - 4);
+ ret = init_get_bits8(&gbc, pkt->data + 4, pkt->size - 4);
if (ret < 0)
goto fail;
if (show_bits_long(&gbc, 32) == 0xf8726fba) {
- if ((ret = ff_mlp_read_major_sync(ctx, &s->hdr, &gbc)) != 0)
+ if ((ret = ff_mlp_read_major_sync(ctx, &s->hdr, &gbc)) < 0)
goto fail;
have_header = 1;
}
- if (s->hdr.num_substreams > MAX_SUBSTREAMS)
+ if (s->hdr.num_substreams > MAX_SUBSTREAMS) {
+ ret = AVERROR_INVALIDDATA;
goto fail;
+ }
- start = get_bits_count(&gbc);
for (i = 0; i < s->hdr.num_substreams; i++) {
for (int j = 0; j < 4; j++)
units[i].bits[j] = get_bits1(&gbc);
- units[i].offset = get_bits(&gbc, 12) * 2;
- if (i < FFMIN(s->hdr.num_substreams, 3)) {
- last_offset = units[i].offset;
- substream_bits += 16;
+ units[i].offset = get_bits(&gbc, 12);
+ if (i < 3) {
+ last_offset = units[i].offset * 2;
+ substream_bytes += 2;
}
if (units[i].bits[0]) {
units[i].optional = get_bits(&gbc, 16);
- if (i < FFMIN(s->hdr.num_substreams, 3))
- substream_bits += 16;
+ if (i < 3)
+ substream_bytes += 2;
}
}
- end = get_bits_count(&gbc);
+ end = get_bits_count(&gbc) >> 3;
- size = ((end + 7) >> 3) + 4 + last_offset;
- if (size >= 0 && size <= in->size)
- out_size = size;
+ out_size = end + 4 + last_offset;
if (out_size < in_size) {
- int bpos = 0, reduce = (end - start - substream_bits) >> 4;
- uint16_t parity_nibble = 0;
+ int bpos = 0, reduce = end - have_header * 28 - substream_bytes;
+ uint16_t parity_nibble, dts = AV_RB16(pkt->data + 2);
uint16_t auheader;
+ uint8_t header[28];
+
+ av_assert1(reduce >= 0 && reduce % 2 == 0);
- ret = av_new_packet(out, out_size);
+ if (have_header) {
+ memcpy(header, pkt->data + 4, 28);
+ header[16] = (header[16] & 0x0c) | (FFMIN(s->hdr.num_substreams, 3) << 4);
+ header[17] &= 0x7f;
+ header[25] &= 0xfe;
+ AV_WL16(header + 26, ff_mlp_checksum16(header, 26));
+ }
+
+ pkt->data += reduce;
+ out_size -= reduce;
+ pkt->size = out_size;
+
+ ret = av_packet_make_writable(pkt);
if (ret < 0)
goto fail;
- AV_WB16(out->data + 2, dts);
+ AV_WB16(pkt->data + 2, dts);
parity_nibble = dts;
- out->size -= reduce * 2;
- parity_nibble ^= out->size / 2;
-
- if (out_size > 8)
- AV_WN64(out->data + out_size - 8, 0);
- if (have_header) {
- memcpy(out->data + 4, in->data + 4, 28);
- out->data[16 + 4] = (out->data[16 + 4] & 0x0f) | (FFMIN(s->hdr.num_substreams, 3) << 4);
- out->data[25 + 4] = out->data[25 + 4] & 0xfe;
- out->data[26 + 4] = 0xff;
- out->data[27 + 4] = 0xff;
- AV_WL16(out->data + 4 + 26, ff_mlp_checksum16(out->data + 4, 26));
- }
+ parity_nibble ^= out_size / 2;
for (i = 0; i < FFMIN(s->hdr.num_substreams, 3); i++) {
uint16_t substr_hdr = 0;
@@ -135,18 +131,18 @@ static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out)
substr_hdr |= (units[i].bits[1] << 14);
substr_hdr |= (units[i].bits[2] << 13);
substr_hdr |= (units[i].bits[3] << 12);
- substr_hdr |= (units[i].offset / 2) & 0x0FFF;
+ substr_hdr |= units[i].offset;
- AV_WB16(out->data + have_header * 28 + 4 + bpos, substr_hdr);
+ AV_WB16(pkt->data + have_header * 28 + 4 + bpos, substr_hdr);
- parity_nibble ^= out->data[have_header * 28 + 4 + bpos++];
- parity_nibble ^= out->data[have_header * 28 + 4 + bpos++];
+ parity_nibble ^= substr_hdr;
+ bpos += 2;
if (units[i].bits[0]) {
- AV_WB16(out->data + have_header * 28 + 4 + bpos, units[i].optional);
+ AV_WB16(pkt->data + have_header * 28 + 4 + bpos, units[i].optional);
- parity_nibble ^= out->data[have_header * 28 + 4 + bpos++];
- parity_nibble ^= out->data[have_header * 28 + 4 + bpos++];
+ parity_nibble ^= units[i].optional;
+ bpos += 2;
}
}
@@ -154,26 +150,27 @@ static int truehd_core_filter(AVBSFContext *ctx, AVPacket *out)
parity_nibble ^= parity_nibble >> 4;
parity_nibble &= 0xF;
- memcpy(out->data + have_header * 28 + 4 + bpos,
- in->data + 4 + (end >> 3),
- out_size - (4 + (end >> 3)));
auheader = (parity_nibble ^ 0xF) << 12;
- auheader |= (out->size / 2) & 0x0fff;
- AV_WB16(out->data, auheader);
+ auheader |= (out_size / 2) & 0x0fff;
+ AV_WB16(pkt->data, auheader);
- ret = av_packet_copy_props(out, in);
- } else {
- av_packet_move_ref(out, in);
+ if (have_header)
+ memcpy(pkt->data + 4, header, 28);
}
fail:
if (ret < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return ret;
}
+static void truehd_core_flush(AVBSFContext *ctx)
+{
+ TrueHDCoreContext *s = ctx->priv_data;
+ memset(&s->hdr, 0, sizeof(s->hdr));
+}
+
static const enum AVCodecID codec_ids[] = {
AV_CODEC_ID_TRUEHD, AV_CODEC_ID_NONE,
};
@@ -182,5 +179,6 @@ const AVBitStreamFilter ff_truehd_core_bsf = {
.name = "truehd_core",
.priv_data_size = sizeof(TrueHDCoreContext),
.filter = truehd_core_filter,
+ .flush = truehd_core_flush,
.codec_ids = codec_ids,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
index 100880c257f..a86dd16e0fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
+++ b/chromium/third_party/ffmpeg/libavcodec/truemotion2.c
@@ -681,14 +681,14 @@ static inline void tm2_still_block(TM2Context *ctx, AVFrame *pic, int bx, int by
static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
{
int i, j;
- int d;
+ unsigned d;
TM2_INIT_POINTERS_2();
/* update chroma */
for (j = 0; j < 2; j++) {
for (i = 0; i < 2; i++) {
- U[i] = Uo[i] + GET_TOK(ctx, TM2_UPD);
- V[i] = Vo[i] + GET_TOK(ctx, TM2_UPD);
+ U[i] = Uo[i] + (unsigned)GET_TOK(ctx, TM2_UPD);
+ V[i] = Vo[i] + (unsigned)GET_TOK(ctx, TM2_UPD);
}
U += Ustride;
V += Vstride;
@@ -701,15 +701,15 @@ static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int b
TM2_RECALC_BLOCK(V, Vstride, (clast + 2), (ctx->CD + 2));
/* update deltas */
- ctx->D[0] = Yo[3] - last[3];
- ctx->D[1] = Yo[3 + oYstride] - Yo[3];
- ctx->D[2] = Yo[3 + oYstride * 2] - Yo[3 + oYstride];
- ctx->D[3] = Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
+ ctx->D[0] = (unsigned)Yo[3] - last[3];
+ ctx->D[1] = (unsigned)Yo[3 + oYstride] - Yo[3];
+ ctx->D[2] = (unsigned)Yo[3 + oYstride * 2] - Yo[3 + oYstride];
+ ctx->D[3] = (unsigned)Yo[3 + oYstride * 3] - Yo[3 + oYstride * 2];
for (j = 0; j < 4; j++) {
d = last[3];
for (i = 0; i < 4; i++) {
- Y[i] = Yo[i] + GET_TOK(ctx, TM2_UPD);
+ Y[i] = Yo[i] + (unsigned)GET_TOK(ctx, TM2_UPD);
last[i] = Y[i];
}
ctx->D[j] = last[3] - d;
diff --git a/chromium/third_party/ffmpeg/libavcodec/tta.c b/chromium/third_party/ffmpeg/libavcodec/tta.c
index 8f097b3bcc7..4d27fcd5551 100644
--- a/chromium/third_party/ffmpeg/libavcodec/tta.c
+++ b/chromium/third_party/ffmpeg/libavcodec/tta.c
@@ -163,7 +163,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->data_length = get_bits_long(&gb, 32);
skip_bits_long(&gb, 32); // CRC32 of header
- if (s->channels == 0) {
+ if (s->channels == 0 || s->channels > 16) {
av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR_INVALIDDATA;
} else if (avctx->sample_rate == 0) {
@@ -372,7 +372,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data,
// shift samples for 24-bit sample format
int32_t *samples = (int32_t *)frame->data[0];
for (i = 0; i < framelen * s->channels; i++)
- *samples++ <<= 8;
+ *samples++ *= 256;
// reset decode buffer
s->decode_buffer = NULL;
break;
diff --git a/chromium/third_party/ffmpeg/libavcodec/utils.c b/chromium/third_party/ffmpeg/libavcodec/utils.c
index cc04b734712..9ff9628f7ff 100644
--- a/chromium/third_party/ffmpeg/libavcodec/utils.c
+++ b/chromium/third_party/ffmpeg/libavcodec/utils.c
@@ -542,6 +542,7 @@ int attribute_align_arg ff_codec_open2_recursive(AVCodecContext *avctx, const AV
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;
+ int codec_init_ok = 0;
AVDictionary *tmp = NULL;
const AVPixFmtDescriptor *pixdesc;
@@ -935,6 +936,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (ret < 0) {
goto free_and_end;
}
+ codec_init_ok = 1;
}
ret=0;
@@ -962,6 +964,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = AVERROR(EINVAL);
goto free_and_end;
}
+ if (avctx->bits_per_coded_sample < 0) {
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
if (avctx->sub_charenc) {
if (avctx->codec_type != AVMEDIA_TYPE_SUBTITLE) {
av_log(avctx, AV_LOG_ERROR, "Character encoding is only "
@@ -1019,7 +1025,8 @@ end:
return ret;
free_and_end:
if (avctx->codec &&
- (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))
+ (codec_init_ok ||
+ (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP)))
avctx->codec->close(avctx);
if (codec->priv_class && codec->priv_data_size)
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210dec.c b/chromium/third_party/ffmpeg/libavcodec/v210dec.c
index ddc5dbe8be6..5a33d8c0899 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v210dec.c
@@ -50,6 +50,13 @@ static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u,
}
}
+av_cold void ff_v210dec_init(V210DecContext *s)
+{
+ s->unpack_frame = v210_planar_unpack_c;
+ if (ARCH_X86)
+ ff_v210_x86_init(s);
+}
+
static av_cold int decode_init(AVCodecContext *avctx)
{
V210DecContext *s = avctx->priv_data;
@@ -57,10 +64,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
avctx->bits_per_raw_sample = 10;
- s->unpack_frame = v210_planar_unpack_c;
-
- if (HAVE_MMX)
- ff_v210_x86_init(s);
+ s->aligned_input = 0;
+ ff_v210dec_init(s);
return 0;
}
@@ -99,11 +104,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
&& avpkt->size - 64 >= stride * avctx->height)
psrc += 64;
- aligned_input = !((uintptr_t)psrc & 0xf) && !(stride & 0xf);
+ aligned_input = !((uintptr_t)psrc & 0x1f) && !(stride & 0x1f);
if (aligned_input != s->aligned_input) {
s->aligned_input = aligned_input;
- if (HAVE_MMX)
- ff_v210_x86_init(s);
+ ff_v210dec_init(s);
}
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
@@ -119,7 +123,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
const uint32_t *src = (const uint32_t*)psrc;
uint32_t val;
- w = (avctx->width / 6) * 6;
+ w = (avctx->width / 12) * 12;
s->unpack_frame(src, y, u, v, w);
y += w;
@@ -127,6 +131,14 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
v += w >> 1;
src += (w << 1) / 3;
+ if (w < avctx->width - 5) {
+ READ_PIXELS(u, y, v);
+ READ_PIXELS(y, u, y);
+ READ_PIXELS(v, y, u);
+ READ_PIXELS(y, v, y);
+ w += 6;
+ }
+
if (w < avctx->width - 1) {
READ_PIXELS(u, y, v);
diff --git a/chromium/third_party/ffmpeg/libavcodec/v210dec.h b/chromium/third_party/ffmpeg/libavcodec/v210dec.h
index 533afc435c4..cfdb29da097 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v210dec.h
+++ b/chromium/third_party/ffmpeg/libavcodec/v210dec.h
@@ -31,6 +31,7 @@ typedef struct {
void (*unpack_frame)(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
} V210DecContext;
+void ff_v210dec_init(V210DecContext *s);
void ff_v210_x86_init(V210DecContext *s);
#endif /* AVCODEC_V210DEC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/v4l2_m2m_dec.c b/chromium/third_party/ffmpeg/libavcodec/v4l2_m2m_dec.c
index 710e40efd81..d0601f0e2fe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/v4l2_m2m_dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/v4l2_m2m_dec.c
@@ -188,7 +188,11 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
ret = ff_v4l2_m2m_codec_init(avctx);
if (ret) {
+ V4L2m2mPriv *priv = avctx->priv_data;
av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
+ s->self_ref = NULL;
+ av_buffer_unref(&priv->context_ref);
+
return ret;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.c
index 2dda4518826..dd2a24de046 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.c
@@ -103,6 +103,29 @@ static int vaapi_encode_make_param_buffer(AVCodecContext *avctx,
return 0;
}
+static int vaapi_encode_make_misc_param_buffer(AVCodecContext *avctx,
+ VAAPIEncodePicture *pic,
+ int type,
+ const void *data, size_t len)
+{
+ // Construct the buffer on the stack - 1KB is much larger than any
+ // current misc parameter buffer type (the largest is EncQuality at
+ // 224 bytes).
+ uint8_t buffer[1024];
+ VAEncMiscParameterBuffer header = {
+ .type = type,
+ };
+ size_t buffer_size = sizeof(header) + len;
+ av_assert0(buffer_size <= sizeof(buffer));
+
+ memcpy(buffer, &header, sizeof(header));
+ memcpy(buffer + sizeof(header), data, len);
+
+ return vaapi_encode_make_param_buffer(avctx, pic,
+ VAEncMiscParameterBufferType,
+ buffer, buffer_size);
+}
+
static int vaapi_encode_wait(AVCodecContext *avctx,
VAAPIEncodePicture *pic)
{
@@ -212,10 +235,10 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
if (pic->type == PICTURE_TYPE_IDR) {
for (i = 0; i < ctx->nb_global_params; i++) {
- err = vaapi_encode_make_param_buffer(avctx, pic,
- VAEncMiscParameterBufferType,
- (char*)ctx->global_params[i],
- ctx->global_params_size[i]);
+ err = vaapi_encode_make_misc_param_buffer(avctx, pic,
+ ctx->global_params_type[i],
+ ctx->global_params[i],
+ ctx->global_params_size[i]);
if (err < 0)
goto fail;
}
@@ -913,6 +936,21 @@ static int vaapi_encode_clear_old(AVCodecContext *avctx)
return 0;
}
+static int vaapi_encode_check_frame(AVCodecContext *avctx,
+ const AVFrame *frame)
+{
+ VAAPIEncodeContext *ctx = avctx->priv_data;
+
+ if ((frame->crop_top || frame->crop_bottom ||
+ frame->crop_left || frame->crop_right) && !ctx->crop_warned) {
+ av_log(avctx, AV_LOG_WARNING, "Cropping information on input "
+ "frames ignored due to lack of API support.\n");
+ ctx->crop_warned = 1;
+ }
+
+ return 0;
+}
+
int ff_vaapi_encode_send_frame(AVCodecContext *avctx, const AVFrame *frame)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
@@ -923,6 +961,10 @@ int ff_vaapi_encode_send_frame(AVCodecContext *avctx, const AVFrame *frame)
av_log(avctx, AV_LOG_DEBUG, "Input frame: %ux%u (%"PRId64").\n",
frame->width, frame->height, frame->pts);
+ err = vaapi_encode_check_frame(avctx, frame);
+ if (err < 0)
+ return err;
+
pic = vaapi_encode_alloc(avctx);
if (!pic)
return AVERROR(ENOMEM);
@@ -1028,20 +1070,15 @@ int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
return 0;
}
-int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt,
- const AVFrame *input_image, int *got_packet)
-{
- return AVERROR(ENOSYS);
-}
-static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx,
- VAEncMiscParameterBuffer *buffer,
- size_t size)
+static av_cold void vaapi_encode_add_global_param(AVCodecContext *avctx, int type,
+ void *buffer, size_t size)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
av_assert0(ctx->nb_global_params < MAX_GLOBAL_PARAMS);
+ ctx->global_params_type[ctx->nb_global_params] = type;
ctx->global_params [ctx->nb_global_params] = buffer;
ctx->global_params_size[ctx->nb_global_params] = size;
@@ -1575,8 +1612,7 @@ rc_mode_found:
rc_bits_per_second, rc_window_size);
}
- ctx->rc_params.misc.type = VAEncMiscParameterTypeRateControl;
- ctx->rc_params.rc = (VAEncMiscParameterRateControl) {
+ ctx->rc_params = (VAEncMiscParameterRateControl) {
.bits_per_second = rc_bits_per_second,
.target_percentage = rc_target_percentage,
.window_size = rc_window_size,
@@ -1591,7 +1627,9 @@ rc_mode_found:
.quality_factor = rc_quality,
#endif
};
- vaapi_encode_add_global_param(avctx, &ctx->rc_params.misc,
+ vaapi_encode_add_global_param(avctx,
+ VAEncMiscParameterTypeRateControl,
+ &ctx->rc_params,
sizeof(ctx->rc_params));
}
@@ -1600,12 +1638,13 @@ rc_mode_found:
"initial fullness %"PRId64" bits.\n",
hrd_buffer_size, hrd_initial_buffer_fullness);
- ctx->hrd_params.misc.type = VAEncMiscParameterTypeHRD;
- ctx->hrd_params.hrd = (VAEncMiscParameterHRD) {
+ ctx->hrd_params = (VAEncMiscParameterHRD) {
.initial_buffer_fullness = hrd_initial_buffer_fullness,
.buffer_size = hrd_buffer_size,
};
- vaapi_encode_add_global_param(avctx, &ctx->hrd_params.misc,
+ vaapi_encode_add_global_param(avctx,
+ VAEncMiscParameterTypeHRD,
+ &ctx->hrd_params,
sizeof(ctx->hrd_params));
}
@@ -1619,11 +1658,13 @@ rc_mode_found:
av_log(avctx, AV_LOG_VERBOSE, "RC framerate: %d/%d (%.2f fps).\n",
fr_num, fr_den, (double)fr_num / fr_den);
- ctx->fr_params.misc.type = VAEncMiscParameterTypeFrameRate;
- ctx->fr_params.fr.framerate = (unsigned int)fr_den << 16 | fr_num;
-
+ ctx->fr_params = (VAEncMiscParameterFrameRate) {
+ .framerate = (unsigned int)fr_den << 16 | fr_num,
+ };
#if VA_CHECK_VERSION(0, 40, 0)
- vaapi_encode_add_global_param(avctx, &ctx->fr_params.misc,
+ vaapi_encode_add_global_param(avctx,
+ VAEncMiscParameterTypeFrameRate,
+ &ctx->fr_params,
sizeof(ctx->fr_params));
#endif
@@ -1885,10 +1926,12 @@ static av_cold int vaapi_encode_init_quality(AVCodecContext *avctx)
quality = attr.value;
}
- ctx->quality_params.misc.type = VAEncMiscParameterTypeQualityLevel;
- ctx->quality_params.quality.quality_level = quality;
-
- vaapi_encode_add_global_param(avctx, &ctx->quality_params.misc,
+ ctx->quality_params = (VAEncMiscParameterBufferQualityLevel) {
+ .quality_level = quality,
+ };
+ vaapi_encode_add_global_param(avctx,
+ VAEncMiscParameterTypeQualityLevel,
+ &ctx->quality_params,
sizeof(ctx->quality_params));
}
#else
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.h b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.h
index 44a8db566e0..eeec06036b2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode.h
@@ -244,28 +244,17 @@ typedef struct VAAPIEncodeContext {
// Global parameters which will be applied at the start of the
// sequence (includes rate control parameters below).
- VAEncMiscParameterBuffer *global_params[MAX_GLOBAL_PARAMS];
+ int global_params_type[MAX_GLOBAL_PARAMS];
+ const void *global_params [MAX_GLOBAL_PARAMS];
size_t global_params_size[MAX_GLOBAL_PARAMS];
int nb_global_params;
// Rate control parameters.
- struct {
- VAEncMiscParameterBuffer misc;
- VAEncMiscParameterRateControl rc;
- } rc_params;
- struct {
- VAEncMiscParameterBuffer misc;
- VAEncMiscParameterHRD hrd;
- } hrd_params;
- struct {
- VAEncMiscParameterBuffer misc;
- VAEncMiscParameterFrameRate fr;
- } fr_params;
+ VAEncMiscParameterRateControl rc_params;
+ VAEncMiscParameterHRD hrd_params;
+ VAEncMiscParameterFrameRate fr_params;
#if VA_CHECK_VERSION(0, 36, 0)
- struct {
- VAEncMiscParameterBuffer misc;
- VAEncMiscParameterBufferQualityLevel quality;
- } quality_params;
+ VAEncMiscParameterBufferQualityLevel quality_params;
#endif
// Per-sequence parameter structure (VAEncSequenceParameterBuffer*).
@@ -314,6 +303,10 @@ typedef struct VAAPIEncodeContext {
int idr_counter;
int gop_counter;
int end_of_stream;
+
+ // The encoder does not support cropping information, so warn about
+ // it the first time we encounter any nonzero crop fields.
+ int crop_warned;
} VAAPIEncodeContext;
enum {
@@ -405,9 +398,6 @@ typedef struct VAAPIEncodeType {
} VAAPIEncodeType;
-int ff_vaapi_encode2(AVCodecContext *avctx, AVPacket *pkt,
- const AVFrame *input_image, int *got_packet);
-
int ff_vaapi_encode_send_frame(AVCodecContext *avctx, const AVFrame *frame);
int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt);
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c
index 4cf99d7c78c..d1427112ea9 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_h264.c
@@ -471,9 +471,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
(ctx->va_bit_rate >> hrd->bit_rate_scale + 6) - 1;
hrd->cpb_size_scale =
- av_clip_uintp2(av_log2(ctx->hrd_params.hrd.buffer_size) - 15 - 4, 4);
+ av_clip_uintp2(av_log2(ctx->hrd_params.buffer_size) - 15 - 4, 4);
hrd->cpb_size_value_minus1[0] =
- (ctx->hrd_params.hrd.buffer_size >> hrd->cpb_size_scale + 4) - 1;
+ (ctx->hrd_params.buffer_size >> hrd->cpb_size_scale + 4) - 1;
// CBR mode as defined for the HRD cannot be achieved without filler
// data, so this flag cannot be set even with VAAPI CBR modes.
@@ -488,8 +488,8 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
// This calculation can easily overflow 32 bits.
bp->nal.initial_cpb_removal_delay[0] = 90000 *
- (uint64_t)ctx->hrd_params.hrd.initial_buffer_fullness /
- ctx->hrd_params.hrd.buffer_size;
+ (uint64_t)ctx->hrd_params.initial_buffer_fullness /
+ ctx->hrd_params.buffer_size;
bp->nal.initial_cpb_removal_delay_offset[0] = 0;
} else {
sps->vui.nal_hrd_parameters_present_flag = 0;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c
index 4dcdc3d16bb..bd029cc9031 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vaapi_encode_mjpeg.c
@@ -227,6 +227,8 @@ static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
JPEGRawScanHeader *sh = &priv->scan.header;
VAEncPictureParameterBufferJPEG *vpic = pic->codec_picture_params;
const AVPixFmtDescriptor *desc;
+ const uint8_t components_rgb[3] = { 'R', 'G', 'B' };
+ const uint8_t components_yuv[3] = { 1, 2, 3 };
const uint8_t *components;
int t, i, quant_scale, len;
@@ -235,9 +237,9 @@ static int vaapi_encode_mjpeg_init_picture_params(AVCodecContext *avctx,
desc = av_pix_fmt_desc_get(priv->common.input_frames->sw_format);
av_assert0(desc);
if (desc->flags & AV_PIX_FMT_FLAG_RGB)
- components = (uint8_t[3]) { 'R', 'G', 'B' };
+ components = components_rgb;
else
- components = (uint8_t[3]) { 1, 2, 3 };
+ components = components_yuv;
// Frame header.
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1_block.c b/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
index 86320db959a..ec5339d2f0d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1_block.c
@@ -508,13 +508,15 @@ static inline int vc1_coded_block_pred(MpegEncContext * s, int n,
* @param codingset set of VLC to decode data
* @see 8.1.3.4
*/
-static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip,
+static int vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip,
int *value, int codingset)
{
GetBitContext *gb = &v->s.gb;
int index, run, level, lst, sign;
index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
+ if (index < 0)
+ return index;
if (index != ff_vc1_ac_sizes[codingset] - 1) {
run = vc1_index_decode_table[codingset][index][0];
level = vc1_index_decode_table[codingset][index][1];
@@ -560,6 +562,8 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip,
*last = lst;
*skip = run;
*value = (level ^ -sign) + sign;
+
+ return 0;
}
/** Decode intra block in intra frames - should be faster than decode_intra_block
@@ -639,7 +643,9 @@ static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n,
zz_table = v->zz_8x8[1];
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 63)
break;
@@ -812,7 +818,9 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n,
}
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 63)
break;
@@ -995,7 +1003,9 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n,
int k;
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 63)
break;
@@ -1161,7 +1171,9 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
i = 0;
last = 0;
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 63)
break;
@@ -1189,7 +1201,9 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
i = 0;
off = (j & 1) * 4 + (j & 2) * 16;
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 15)
break;
@@ -1216,7 +1230,9 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
i = 0;
off = j * 32;
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 31)
break;
@@ -1243,7 +1259,9 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n,
i = 0;
off = j * 4;
while (!last) {
- vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, v->codingset2);
+ if (ret < 0)
+ return ret;
i += skip;
if (i > 31)
break;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
index 778b811f1ae..c25a6f3adf8 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vc1dsp.c
@@ -95,10 +95,10 @@ static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom)
d1 = a - d;
d2 = a - d + b - c;
- top[48] = ((a << 3) - d1 + rnd1) >> 3;
- top[56] = ((b << 3) - d2 + rnd2) >> 3;
- bottom[0] = ((c << 3) + d2 + rnd1) >> 3;
- bottom[8] = ((d << 3) + d1 + rnd2) >> 3;
+ top[48] = ((a * 8) - d1 + rnd1) >> 3;
+ top[56] = ((b * 8) - d2 + rnd2) >> 3;
+ bottom[0] = ((c * 8) + d2 + rnd1) >> 3;
+ bottom[8] = ((d * 8) + d1 + rnd2) >> 3;
bottom++;
top++;
@@ -122,10 +122,10 @@ static void vc1_h_s_overlap_c(int16_t *left, int16_t *right, int left_stride, in
d1 = a - d;
d2 = a - d + b - c;
- left[6] = ((a << 3) - d1 + rnd1) >> 3;
- left[7] = ((b << 3) - d2 + rnd2) >> 3;
- right[0] = ((c << 3) + d2 + rnd1) >> 3;
- right[1] = ((d << 3) + d1 + rnd2) >> 3;
+ left[6] = ((a * 8) - d1 + rnd1) >> 3;
+ left[7] = ((b * 8) - d2 + rnd2) >> 3;
+ right[0] = ((c * 8) + d2 + rnd1) >> 3;
+ right[1] = ((d * 8) + d1 + rnd2) >> 3;
right += right_stride;
left += left_stride;
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c b/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c
index 421135bce25..024ac6e2f22 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_hevc.c
@@ -38,6 +38,9 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
VdpPictureInfoHEVC *info = &pic_ctx->info.hevc;
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ VdpPictureInfoHEVC444 *info2 = &pic_ctx->info.hevc_444;
+#endif
const HEVCSPS *sps = h->ps.sps;
const HEVCPPS *pps = h->ps.pps;
@@ -355,6 +358,41 @@ static int vdpau_hevc_start_frame(AVCodecContext *avctx,
}
}
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ if (sps->sps_range_extension_flag) {
+ info2->sps_range_extension_flag = 1;
+ info2->transformSkipRotationEnableFlag = sps->transform_skip_rotation_enabled_flag;
+ info2->transformSkipContextEnableFlag = sps->transform_skip_context_enabled_flag;
+ info2->implicitRdpcmEnableFlag = sps->implicit_rdpcm_enabled_flag;
+ info2->explicitRdpcmEnableFlag = sps->explicit_rdpcm_enabled_flag;
+ info2->extendedPrecisionProcessingFlag = sps->extended_precision_processing_flag;
+ info2->intraSmoothingDisabledFlag = sps->intra_smoothing_disabled_flag;
+ info2->highPrecisionOffsetsEnableFlag = sps->high_precision_offsets_enabled_flag;
+ info2->persistentRiceAdaptationEnableFlag = sps->persistent_rice_adaptation_enabled_flag;
+ info2->cabacBypassAlignmentEnableFlag = sps->cabac_bypass_alignment_enabled_flag;
+ } else {
+ info2->sps_range_extension_flag = 0;
+ }
+ if (pps->pps_range_extensions_flag) {
+ info2->pps_range_extension_flag = 1;
+ info2->log2MaxTransformSkipSize = pps->log2_max_transform_skip_block_size;
+ info2->crossComponentPredictionEnableFlag = pps->cross_component_prediction_enabled_flag;
+ info2->chromaQpAdjustmentEnableFlag = pps->chroma_qp_offset_list_enabled_flag;
+ info2->diffCuChromaQpAdjustmentDepth = pps->diff_cu_chroma_qp_offset_depth;
+ info2->chromaQpAdjustmentTableSize = pps->chroma_qp_offset_list_len_minus1 + 1;
+ info2->log2SaoOffsetScaleLuma = pps->log2_sao_offset_scale_luma;
+ info2->log2SaoOffsetScaleChroma = pps->log2_sao_offset_scale_chroma;
+ for (ssize_t i = 0; i < info2->chromaQpAdjustmentTableSize; i++)
+ {
+ info2->cb_qp_adjustment[i] = pps->cb_qp_offset_list[i];
+ info2->cr_qp_adjustment[i] = pps->cr_qp_offset_list[i];
+ }
+
+ } else {
+ info2->pps_range_extension_flag = 0;
+ }
+#endif
+
return ff_vdpau_common_start_frame(pic_ctx, buffer, size);
}
@@ -406,6 +444,9 @@ static int vdpau_hevc_init(AVCodecContext *avctx)
case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
break;
+ case FF_PROFILE_HEVC_REXT:
+ profile = VDP_DECODER_PROFILE_HEVC_MAIN_444;
+ break;
default:
return AVERROR(ENOTSUP);
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
index 4d63e50b165..1ee38dbc55b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vdpau_internal.h
@@ -51,6 +51,9 @@ union VDPAUPictureInfo {
#ifdef VDP_DECODER_PROFILE_HEVC_MAIN
VdpPictureInfoHEVC hevc;
#endif
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ VdpPictureInfoHEVC444 hevc_444;
+#endif
};
typedef struct VDPAUHWContext {
diff --git a/chromium/third_party/ffmpeg/libavcodec/version.h b/chromium/third_party/ffmpeg/libavcodec/version.h
index 195e21bfbee..3583499f192 100644
--- a/chromium/third_party/ffmpeg/libavcodec/version.h
+++ b/chromium/third_party/ffmpeg/libavcodec/version.h
@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
-#define LIBAVCODEC_VERSION_MINOR 52
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MINOR 53
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
index 94c1b7188d2..55123a58446 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
+++ b/chromium/third_party/ffmpeg/libavcodec/videodsp_template.c
@@ -44,7 +44,8 @@ void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
src_y = 1 - block_h;
}
if (src_x >= w) {
- src += (w - 1 - src_x) * sizeof(pixel);
+ // The subtracted expression has an unsigned type and must thus not be negative
+ src -= (1 + src_x - w) * sizeof(pixel);
src_x = w - 1;
} else if (src_x <= -block_w) {
src += (1 - block_w - src_x) * sizeof(pixel);
diff --git a/chromium/third_party/ffmpeg/libavcodec/videotoolboxenc.c b/chromium/third_party/ffmpeg/libavcodec/videotoolboxenc.c
index 50aba2d87f9..ff33c279c3a 100644
--- a/chromium/third_party/ffmpeg/libavcodec/videotoolboxenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/videotoolboxenc.c
@@ -39,6 +39,11 @@
enum { kCMVideoCodecType_HEVC = 'hvc1' };
#endif
+#if !HAVE_KCVPIXELFORMATTYPE_420YPCBCR10BIPLANARVIDEORANGE
+enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
+enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
+#endif
+
typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc,
size_t parameterSetIndex,
const uint8_t **parameterSetPointerOut,
@@ -210,6 +215,7 @@ typedef struct VTEncContext {
int64_t frames_after;
int64_t allow_sw;
+ int64_t require_sw;
bool flushing;
bool has_b_frames;
@@ -761,6 +767,11 @@ static int get_cv_pixel_format(AVCodecContext* avctx,
*av_pixel_format = range == AVCOL_RANGE_JPEG ?
kCVPixelFormatType_420YpCbCr8PlanarFullRange :
kCVPixelFormatType_420YpCbCr8Planar;
+ } else if (fmt == AV_PIX_FMT_P010LE) {
+ *av_pixel_format = range == AVCOL_RANGE_JPEG ?
+ kCVPixelFormatType_420YpCbCr10BiPlanarFullRange :
+ kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange;
+ *av_pixel_format = kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange;
} else {
return AVERROR(EINVAL);
}
@@ -1314,7 +1325,11 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
if (!enc_info) return AVERROR(ENOMEM);
#if !TARGET_OS_IPHONE
- if (!vtctx->allow_sw) {
+ if(vtctx->require_sw) {
+ CFDictionarySetValue(enc_info,
+ compat_keys.kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder,
+ kCFBooleanFalse);
+ } else if (!vtctx->allow_sw) {
CFDictionarySetValue(enc_info,
compat_keys.kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder,
kCFBooleanTrue);
@@ -1981,6 +1996,17 @@ static int get_cv_pixel_info(
strides[2] = frame ? frame->linesize[2] : (avctx->width + 1) / 2;
break;
+ case AV_PIX_FMT_P010LE:
+ *plane_count = 2;
+ widths[0] = avctx->width;
+ heights[0] = avctx->height;
+ strides[0] = frame ? frame->linesize[0] : (avctx->width * 2 + 63) & -64;
+
+ widths[1] = (avctx->width + 1) / 2;
+ heights[1] = (avctx->height + 1) / 2;
+ strides[1] = frame ? frame->linesize[1] : ((avctx->width + 1) / 2 + 63) & -64;
+ break;
+
default:
av_log(
avctx,
@@ -2006,19 +2032,6 @@ static int get_cv_pixel_info(
return 0;
}
-#if !TARGET_OS_IPHONE
-//Not used on iOS - frame is always copied.
-static void free_avframe(
- void *release_ctx,
- const void *data,
- size_t size,
- size_t plane_count,
- const void *plane_addresses[])
-{
- AVFrame *frame = release_ctx;
- av_frame_free(&frame);
-}
-#else
//Not used on OSX - frame is never copied.
static int copy_avframe_to_pixel_buffer(AVCodecContext *avctx,
const AVFrame *frame,
@@ -2111,7 +2124,6 @@ static int copy_avframe_to_pixel_buffer(AVCodecContext *avctx,
return 0;
}
-#endif //!TARGET_OS_IPHONE
static int create_cv_pixel_buffer(AVCodecContext *avctx,
const AVFrame *frame,
@@ -2124,18 +2136,8 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx,
size_t strides[AV_NUM_DATA_POINTERS];
int status;
size_t contiguous_buf_size;
-#if TARGET_OS_IPHONE
CVPixelBufferPoolRef pix_buf_pool;
VTEncContext* vtctx = avctx->priv_data;
-#else
- CFMutableDictionaryRef pix_buf_attachments = CFDictionaryCreateMutable(
- kCFAllocatorDefault,
- 10,
- &kCFCopyStringDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
- if (!pix_buf_attachments) return AVERROR(ENOMEM);
-#endif
if (avctx->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX) {
av_assert0(frame->format == AV_PIX_FMT_VIDEOTOOLBOX);
@@ -2175,7 +2177,6 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx,
return AVERROR_EXTERNAL;
}
-#if TARGET_OS_IPHONE
pix_buf_pool = VTCompressionSessionGetPixelBufferPool(vtctx->session);
if (!pix_buf_pool) {
/* On iOS, the VT session is invalidated when the APP switches from
@@ -2217,43 +2218,6 @@ static int create_cv_pixel_buffer(AVCodecContext *avctx,
*cv_img = NULL;
return status;
}
-#else
- AVFrame *enc_frame = av_frame_alloc();
- if (!enc_frame) return AVERROR(ENOMEM);
-
- status = av_frame_ref(enc_frame, frame);
- if (status) {
- av_frame_free(&enc_frame);
- return status;
- }
-
- status = CVPixelBufferCreateWithPlanarBytes(
- kCFAllocatorDefault,
- enc_frame->width,
- enc_frame->height,
- color,
- NULL,
- contiguous_buf_size,
- plane_count,
- (void **)enc_frame->data,
- widths,
- heights,
- strides,
- free_avframe,
- enc_frame,
- NULL,
- cv_img
- );
-
- add_color_attr(avctx, pix_buf_attachments);
- CVBufferSetAttachments(*cv_img, pix_buf_attachments, kCVAttachmentMode_ShouldPropagate);
- CFRelease(pix_buf_attachments);
-
- if (status) {
- av_log(avctx, AV_LOG_ERROR, "Error: Could not create CVPixelBuffer: %d\n", status);
- return AVERROR_EXTERNAL;
- }
-#endif
return 0;
}
@@ -2405,21 +2369,11 @@ static int vtenc_populate_extradata(AVCodecContext *avctx,
CFDictionaryRef pixel_buffer_info)
{
VTEncContext *vtctx = avctx->priv_data;
- AVFrame *frame = av_frame_alloc();
- int y_size = avctx->width * avctx->height;
- int chroma_size = (avctx->width / 2) * (avctx->height / 2);
- CMSampleBufferRef buf = NULL;
int status;
-
- if (!frame)
- return AVERROR(ENOMEM);
-
- frame->buf[0] = av_buffer_alloc(y_size + 2 * chroma_size);
-
- if(!frame->buf[0]){
- status = AVERROR(ENOMEM);
- goto pe_cleanup;
- }
+ CVPixelBufferPoolRef pool = NULL;
+ CVPixelBufferRef pix_buf = NULL;
+ CMTime time;
+ CMSampleBufferRef buf = NULL;
status = vtenc_create_encoder(avctx,
codec_type,
@@ -2431,39 +2385,36 @@ static int vtenc_populate_extradata(AVCodecContext *avctx,
if (status)
goto pe_cleanup;
- frame->data[0] = frame->buf[0]->data;
- memset(frame->data[0], 0, y_size);
-
- frame->data[1] = frame->buf[0]->data + y_size;
- memset(frame->data[1], 128, chroma_size);
-
-
- if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
- frame->data[2] = frame->buf[0]->data + y_size + chroma_size;
- memset(frame->data[2], 128, chroma_size);
+ pool = VTCompressionSessionGetPixelBufferPool(vtctx->session);
+ if(!pool){
+ av_log(avctx, AV_LOG_ERROR, "Error getting pixel buffer pool.\n");
+ goto pe_cleanup;
}
- frame->linesize[0] = avctx->width;
+ status = CVPixelBufferPoolCreatePixelBuffer(NULL,
+ pool,
+ &pix_buf);
- if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
- frame->linesize[1] =
- frame->linesize[2] = (avctx->width + 1) / 2;
- } else {
- frame->linesize[1] = (avctx->width + 1) / 2;
+ if(status != kCVReturnSuccess){
+ av_log(avctx, AV_LOG_ERROR, "Error creating frame from pool: %d\n", status);
+ goto pe_cleanup;
}
- frame->format = avctx->pix_fmt;
- frame->width = avctx->width;
- frame->height = avctx->height;
- frame->colorspace = avctx->colorspace;
- frame->color_range = avctx->color_range;
- frame->color_trc = avctx->color_trc;
- frame->color_primaries = avctx->color_primaries;
+ time = CMTimeMake(0, avctx->time_base.den);
+ status = VTCompressionSessionEncodeFrame(vtctx->session,
+ pix_buf,
+ time,
+ kCMTimeInvalid,
+ NULL,
+ NULL,
+ NULL);
- frame->pts = 0;
- status = vtenc_send_frame(avctx, vtctx, frame);
if (status) {
- av_log(avctx, AV_LOG_ERROR, "Error sending frame: %d\n", status);
+ av_log(avctx,
+ AV_LOG_ERROR,
+ "Error sending frame for extradata: %d\n",
+ status);
+
goto pe_cleanup;
}
@@ -2491,9 +2442,6 @@ pe_cleanup:
vtctx->session = NULL;
vtctx->frame_ct_out = 0;
- av_frame_unref(frame);
- av_frame_free(&frame);
-
av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0));
return status;
@@ -2532,17 +2480,27 @@ static av_cold int vtenc_close(AVCodecContext *avctx)
return 0;
}
-static const enum AVPixelFormat pix_fmts[] = {
+static const enum AVPixelFormat avc_pix_fmts[] = {
AV_PIX_FMT_VIDEOTOOLBOX,
AV_PIX_FMT_NV12,
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE
};
+static const enum AVPixelFormat hevc_pix_fmts[] = {
+ AV_PIX_FMT_VIDEOTOOLBOX,
+ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_P010LE,
+ AV_PIX_FMT_NONE
+};
+
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define COMMON_OPTIONS \
{ "allow_sw", "Allow software encoding", OFFSET(allow_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
+ { "require_sw", "Require software encoding", OFFSET(require_sw), AV_OPT_TYPE_BOOL, \
+ { .i64 = 0 }, 0, 1, VE }, \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
@@ -2594,7 +2552,7 @@ AVCodec ff_h264_videotoolbox_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
.priv_data_size = sizeof(VTEncContext),
- .pix_fmts = pix_fmts,
+ .pix_fmts = avc_pix_fmts,
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
@@ -2626,7 +2584,7 @@ AVCodec ff_hevc_videotoolbox_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,
.priv_data_size = sizeof(VTEncContext),
- .pix_fmts = pix_fmts,
+ .pix_fmts = hevc_pix_fmts,
.init = vtenc_init,
.encode2 = vtenc_frame,
.close = vtenc_close,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vmnc.c b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
index 30b1414e494..e2730433114 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vmnc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vmnc.c
@@ -333,11 +333,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
uint8_t *outptr;
int dx, dy, w, h, depth, enc, chunks, res, size_left, ret;
+ bytestream2_init(gb, buf, buf_size);
+ bytestream2_skip(gb, 2);
+ chunks = bytestream2_get_be16(gb);
+ if (12LL * chunks > bytestream2_get_bytes_left(gb))
+ return AVERROR_INVALIDDATA;
+
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
return ret;
- bytestream2_init(gb, buf, buf_size);
-
c->pic->key_frame = 0;
c->pic->pict_type = AV_PICTURE_TYPE_P;
@@ -369,8 +373,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
}
}
- bytestream2_skip(gb, 2);
- chunks = bytestream2_get_be16(gb);
+
while (chunks--) {
if (bytestream2_get_bytes_left(gb) < 12) {
av_log(avctx, AV_LOG_ERROR, "Premature end of data!\n");
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3.c b/chromium/third_party/ffmpeg/libavcodec/vp3.c
index b248c904139..a6f759ebf5b 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2003-2004 The FFmpeg project
+ * Copyright (C) 2019 Peter Ross
*
* This file is part of FFmpeg.
*
@@ -20,7 +21,7 @@
/**
* @file
- * On2 VP3 Video Decoder
+ * On2 VP3/VP4 Video Decoder
*
* VP3 Video Decoder by Mike Melanson (mike at multimedia.cx)
* For more information about the VP3 coding process, visit:
@@ -43,6 +44,7 @@
#include "thread.h"
#include "videodsp.h"
#include "vp3data.h"
+#include "vp4data.h"
#include "vp3dsp.h"
#include "xiph.h"
@@ -127,6 +129,30 @@ static const uint8_t hilbert_offset[16][2] = {
{ 3, 1 }, { 2, 1 }, { 2, 0 }, { 3, 0 }
};
+enum {
+ VP4_DC_INTRA = 0,
+ VP4_DC_INTER = 1,
+ VP4_DC_GOLDEN = 2,
+ NB_VP4_DC_TYPES,
+ VP4_DC_UNDEFINED = NB_VP4_DC_TYPES
+};
+
+static const uint8_t vp4_pred_block_type_map[8] = {
+ [MODE_INTER_NO_MV] = VP4_DC_INTER,
+ [MODE_INTRA] = VP4_DC_INTRA,
+ [MODE_INTER_PLUS_MV] = VP4_DC_INTER,
+ [MODE_INTER_LAST_MV] = VP4_DC_INTER,
+ [MODE_INTER_PRIOR_LAST] = VP4_DC_INTER,
+ [MODE_USING_GOLDEN] = VP4_DC_GOLDEN,
+ [MODE_GOLDEN_MV] = VP4_DC_GOLDEN,
+ [MODE_INTER_FOURMV] = VP4_DC_INTER,
+};
+
+typedef struct {
+ int dc;
+ int type;
+} VP4Predictor;
+
#define MIN_DEQUANT_VAL 2
typedef struct Vp3DecodeContext {
@@ -164,9 +190,13 @@ typedef struct Vp3DecodeContext {
int v_superblock_start;
unsigned char *superblock_coding;
- int macroblock_count;
+ int macroblock_count; /* y macroblock count */
int macroblock_width;
int macroblock_height;
+ int c_macroblock_count;
+ int c_macroblock_width;
+ int c_macroblock_height;
+ int yuv_macroblock_count; /* y+u+v macroblock count */
int fragment_count;
int fragment_width[2];
@@ -182,7 +212,7 @@ typedef struct Vp3DecodeContext {
int8_t (*motion_val[2])[2];
/* tables */
- uint16_t coded_dc_scale_factor[64];
+ uint16_t coded_dc_scale_factor[2][64];
uint32_t coded_ac_scale_factor[64];
uint8_t base_matrix[384][64];
uint8_t qr_count[2][3];
@@ -233,10 +263,12 @@ typedef struct Vp3DecodeContext {
VLC ac_vlc_3[16];
VLC ac_vlc_4[16];
- VLC superblock_run_length_vlc;
- VLC fragment_run_length_vlc;
+ VLC superblock_run_length_vlc; /* version < 2 */
+ VLC fragment_run_length_vlc; /* version < 2 */
+ VLC block_pattern_vlc[2]; /* version >= 2*/
VLC mode_code_vlc;
- VLC motion_vector_vlc;
+ VLC motion_vector_vlc; /* version < 2 */
+ VLC vp4_mv_vlc[2][7]; /* version >=2 */
/* these arrays need to be on 16-byte boundaries since SSE2 operations
* index into them */
@@ -263,6 +295,8 @@ typedef struct Vp3DecodeContext {
uint8_t filter_limit_values[64];
DECLARE_ALIGNED(8, int, bounding_values_array)[256 + 2];
+
+ VP4Predictor * dc_pred_row; /* dc_pred_row[y_superblock_width * 4] */
} Vp3DecodeContext;
/************************************************************************
@@ -280,6 +314,7 @@ static av_cold void free_tables(AVCodecContext *avctx)
av_freep(&s->dct_tokens_base);
av_freep(&s->superblock_fragments);
av_freep(&s->macroblock_coding);
+ av_freep(&s->dc_pred_row);
av_freep(&s->motion_val[0]);
av_freep(&s->motion_val[1]);
}
@@ -299,7 +334,7 @@ static void vp3_decode_flush(AVCodecContext *avctx)
static av_cold int vp3_decode_end(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;
- int i;
+ int i, j;
free_tables(avctx);
av_freep(&s->edge_emu_buffer);
@@ -328,6 +363,12 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
ff_free_vlc(&s->mode_code_vlc);
ff_free_vlc(&s->motion_vector_vlc);
+ for (j = 0; j < 2; j++)
+ for (i = 0; i < 7; i++)
+ ff_free_vlc(&s->vp4_mv_vlc[j][i]);
+
+ for (i = 0; i < 2; i++)
+ ff_free_vlc(&s->block_pattern_vlc[i]);
return 0;
}
@@ -375,11 +416,11 @@ static int init_block_mapping(Vp3DecodeContext *s)
static void init_dequantizer(Vp3DecodeContext *s, int qpi)
{
int ac_scale_factor = s->coded_ac_scale_factor[s->qps[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 dc_scale_factor = s->coded_dc_scale_factor[!!plane][s->qps[qpi]];
int sum = 0;
for (qri = 0; qri < s->qr_count[inter][plane]; qri++) {
sum += s->qr_size[inter][plane][qri];
@@ -397,9 +438,10 @@ static void init_dequantizer(Vp3DecodeContext *s, int qpi)
int qmin = 8 << (inter + !i);
int qscale = i ? ac_scale_factor : dc_scale_factor;
-
+ int qbias = (1 + inter) * 3;
s->qmat[qpi][inter][plane][s->idct_permutation[i]] =
- av_clip((qscale * coeff) / 100 * 4, qmin, 4096);
+ (i == 0 || s->version < 2) ? av_clip((qscale * coeff) / 100 * 4, qmin, 4096)
+ : (qscale * (coeff - qbias) / 100 + qbias) * 4;
}
/* all DC coefficients use the same quant so as not to interfere
* with DC prediction */
@@ -598,6 +640,148 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb)
return 0;
}
+#define BLOCK_X (2 * mb_x + (k & 1))
+#define BLOCK_Y (2 * mb_y + (k >> 1))
+
+#if CONFIG_VP4_DECODER
+/**
+ * @return number of blocks, or > yuv_macroblock_count on error.
+ * return value is always >= 1.
+ */
+static int vp4_get_mb_count(Vp3DecodeContext *s, GetBitContext *gb)
+{
+ int v = 1;
+ int bits;
+ while ((bits = show_bits(gb, 9)) == 0x1ff) {
+ skip_bits(gb, 9);
+ v += 256;
+ if (v > s->yuv_macroblock_count) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid run length\n");
+ return v;
+ }
+ }
+#define body(n) { \
+ skip_bits(gb, 2 + n); \
+ v += (1 << n) + get_bits(gb, n); }
+#define thresh(n) (0x200 - (0x80 >> n))
+#define else_if(n) else if (bits < thresh(n)) body(n)
+ if (bits < 0x100) {
+ skip_bits(gb, 1);
+ } else if (bits < thresh(0)) {
+ skip_bits(gb, 2);
+ v += 1;
+ }
+ else_if(1)
+ else_if(2)
+ else_if(3)
+ else_if(4)
+ else_if(5)
+ else_if(6)
+ else body(7)
+#undef body
+#undef thresh
+#undef else_if
+ return v;
+}
+
+static int vp4_get_block_pattern(Vp3DecodeContext *s, GetBitContext *gb, int *next_block_pattern_table)
+{
+ int v = get_vlc2(gb, s->block_pattern_vlc[*next_block_pattern_table].table, 3, 2);
+ if (v == -1) {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid block pattern\n");
+ *next_block_pattern_table = 0;
+ return 0;
+ }
+ *next_block_pattern_table = vp4_block_pattern_table_selector[v];
+ return v + 1;
+}
+
+static int vp4_unpack_macroblocks(Vp3DecodeContext *s, GetBitContext *gb)
+{
+ int plane, i, j, k, fragment;
+ int next_block_pattern_table;
+ int bit, current_run, has_partial;
+
+ memset(s->macroblock_coding, MODE_COPY, s->macroblock_count);
+
+ if (s->keyframe)
+ return 0;
+
+ has_partial = 0;
+ bit = get_bits1(gb);
+ for (i = 0; i < s->yuv_macroblock_count; i += current_run) {
+ current_run = vp4_get_mb_count(s, gb);
+ if (current_run > s->yuv_macroblock_count - i)
+ return -1;
+ memset(s->superblock_coding + i, 2 * bit, current_run);
+ bit ^= 1;
+ has_partial |= bit;
+ }
+
+ if (has_partial) {
+ bit = get_bits1(gb);
+ current_run = vp4_get_mb_count(s, gb);
+ for (i = 0; i < s->yuv_macroblock_count; i++) {
+ if (!s->superblock_coding[i]) {
+ if (!current_run) {
+ bit ^= 1;
+ current_run = vp4_get_mb_count(s, gb);
+ }
+ s->superblock_coding[i] = bit;
+ current_run--;
+ }
+ }
+ if (current_run) /* handle situation when vp4_get_mb_count() fails */
+ return -1;
+ }
+
+ next_block_pattern_table = 0;
+ i = 0;
+ for (plane = 0; plane < 3; plane++) {
+ int sb_x, sb_y;
+ 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 mb_width = plane ? s->c_macroblock_width : s->macroblock_width;
+ int mb_height = plane ? s->c_macroblock_height : s->macroblock_height;
+ int fragment_width = s->fragment_width[!!plane];
+ int fragment_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 (j = 0; j < 4; j++) {
+ int mb_x = 2 * sb_x + (j >> 1);
+ int mb_y = 2 * sb_y + (j >> 1) ^ (j & 1);
+ int mb_coded, pattern, coded;
+
+ if (mb_x >= mb_width || mb_y >= mb_height)
+ continue;
+
+ mb_coded = s->superblock_coding[i++];
+
+ if (mb_coded == SB_FULLY_CODED)
+ pattern = 0xF;
+ else if (mb_coded == SB_PARTIALLY_CODED)
+ pattern = vp4_get_block_pattern(s, gb, &next_block_pattern_table);
+ else
+ pattern = 0;
+
+ for (k = 0; k < 4; k++) {
+ if (BLOCK_X >= fragment_width || BLOCK_Y >= fragment_height)
+ continue;
+ fragment = s->fragment_start[plane] + BLOCK_Y * fragment_width + BLOCK_X;
+ coded = pattern & (8 >> k);
+ /* MODE_INTER_NO_MV is the default for coded fragments.
+ the actual method is decoded in the next phase. */
+ s->all_fragments[fragment].coding_method = coded ? MODE_INTER_NO_MV : MODE_COPY;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+}
+#endif
+
/*
* This function unpacks all the coding mode data for individual macroblocks
* from the bitstream.
@@ -646,8 +830,6 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
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 */
@@ -707,6 +889,12 @@ static int unpack_modes(Vp3DecodeContext *s, GetBitContext *gb)
return 0;
}
+static int vp4_get_mv(Vp3DecodeContext *s, GetBitContext *gb, int axis, int last_motion)
+{
+ int v = get_vlc2(gb, s->vp4_mv_vlc[axis][vp4_mv_table_selector[FFABS(last_motion)]].table, 6, 2) - 31;
+ return last_motion < 0 ? -v : v;
+}
+
/*
* This function unpacks all the motion vectors for the individual
* macroblocks from the bitstream.
@@ -721,6 +909,8 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
int last_motion_y = 0;
int prior_last_motion_x = 0;
int prior_last_motion_y = 0;
+ int last_gold_motion_x = 0;
+ int last_gold_motion_y = 0;
int current_macroblock;
int current_fragment;
int frag;
@@ -728,8 +918,8 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
if (s->keyframe)
return 0;
- /* coding mode 0 is the VLC scheme; 1 is the fixed code scheme */
- coding_mode = get_bits1(gb);
+ /* coding mode 0 is the VLC scheme; 1 is the fixed code scheme; 2 is VP4 code scheme */
+ coding_mode = s->version < 2 ? get_bits1(gb) : 2;
/* iterate through all of the macroblocks that contain 1 or more
* coded fragments */
@@ -749,15 +939,23 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
continue;
switch (s->macroblock_coding[current_macroblock]) {
- case MODE_INTER_PLUS_MV:
case MODE_GOLDEN_MV:
+ if (coding_mode == 2) { /* VP4 */
+ last_gold_motion_x = motion_x[0] = vp4_get_mv(s, gb, 0, last_gold_motion_x);
+ last_gold_motion_y = motion_y[0] = vp4_get_mv(s, gb, 1, last_gold_motion_y);
+ break;
+ } /* otherwise fall through */
+ case MODE_INTER_PLUS_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 {
+ } else if (coding_mode == 1) {
motion_x[0] = fixed_motion_vector_table[get_bits(gb, 6)];
motion_y[0] = fixed_motion_vector_table[get_bits(gb, 6)];
+ } else { /* VP4 */
+ motion_x[0] = vp4_get_mv(s, gb, 0, last_motion_x);
+ motion_y[0] = vp4_get_mv(s, gb, 1, last_motion_y);
}
/* vector maintenance, only on MODE_INTER_PLUS_MV */
@@ -782,9 +980,12 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
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 {
+ } else if (coding_mode == 1) {
motion_x[k] = fixed_motion_vector_table[get_bits(gb, 6)];
motion_y[k] = fixed_motion_vector_table[get_bits(gb, 6)];
+ } else { /* VP4 */
+ motion_x[k] = vp4_get_mv(s, gb, 0, prior_last_motion_x);
+ motion_y[k] = vp4_get_mv(s, gb, 1, prior_last_motion_y);
}
last_motion_x = motion_x[k];
last_motion_y = motion_y[k];
@@ -846,8 +1047,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
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);
+ if (s->version <= 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];
@@ -861,9 +1064,10 @@ static int unpack_vectors(Vp3DecodeContext *s, GetBitContext *gb)
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);
-
+ if (s->version <= 2) {
+ 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];
@@ -931,6 +1135,30 @@ static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
return 0;
}
+static inline int get_eob_run(GetBitContext *gb, int token)
+{
+ int v = eob_run_table[token].base;
+ if (eob_run_table[token].bits)
+ v += get_bits(gb, eob_run_table[token].bits);
+ return v;
+}
+
+static inline int get_coeff(GetBitContext *gb, int token, int16_t *coeff)
+{
+ int bits_to_get, zero_run;
+
+ 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]);
+
+ return zero_run;
+}
+
/*
* This function is called by unpack_dct_coeffs() to extract the VLCs from
* the bitstream. The VLCs encode tokens which are used to unpack DCT
@@ -952,7 +1180,6 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
int token;
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];
@@ -988,10 +1215,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
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]);
-
+ eob_run = get_eob_run(gb, token);
if (!eob_run)
eob_run = INT_MAX;
@@ -1009,14 +1233,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
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]);
+ zero_run = get_coeff(gb, token, &coeff);
if (zero_run) {
dct_tokens[j++] = TOKEN_ZERO_RUN(coeff, zero_run);
@@ -1168,6 +1385,235 @@ static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
return 0;
}
+#if CONFIG_VP4_DECODER
+/**
+ * eob_tracker[] is instead of TOKEN_EOB(value)
+ * a dummy TOKEN_EOB(0) value is used to make vp3_dequant work
+ *
+ * @return < 0 on error
+ */
+static int vp4_unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb,
+ VLC *vlc_tables[64],
+ int plane, int eob_tracker[64], int fragment)
+{
+ int token;
+ int zero_run = 0;
+ int16_t coeff = 0;
+ int coeff_i = 0;
+ int eob_run;
+
+ while (!eob_tracker[coeff_i]) {
+
+ token = get_vlc2(gb, vlc_tables[coeff_i]->table, 11, 3);
+
+ /* use the token to get a zero run, a coefficient, and an eob run */
+ if ((unsigned) token <= 6U) {
+ eob_run = get_eob_run(gb, token);
+ *s->dct_tokens[plane][coeff_i]++ = TOKEN_EOB(0);
+ eob_tracker[coeff_i] = eob_run - 1;
+ return 0;
+ } else if (token >= 0) {
+ zero_run = get_coeff(gb, token, &coeff);
+
+ if (zero_run) {
+ if (coeff_i + zero_run > 64) {
+ av_log(s->avctx, AV_LOG_DEBUG,
+ "Invalid zero run of %d with %d coeffs left\n",
+ zero_run, 64 - coeff_i);
+ zero_run = 64 - coeff_i;
+ }
+ *s->dct_tokens[plane][coeff_i]++ = TOKEN_ZERO_RUN(coeff, zero_run);
+ coeff_i += zero_run;
+ } else {
+ if (!coeff_i)
+ s->all_fragments[fragment].dc = coeff;
+
+ *s->dct_tokens[plane][coeff_i]++ = TOKEN_COEFF(coeff);
+ }
+ coeff_i++;
+ if (coeff_i >= 64) /* > 64 occurs when there is a zero_run overflow */
+ return 0; /* stop */
+ } else {
+ av_log(s->avctx, AV_LOG_ERROR, "Invalid token %d\n", token);
+ return -1;
+ }
+ }
+ *s->dct_tokens[plane][coeff_i]++ = TOKEN_EOB(0);
+ eob_tracker[coeff_i]--;
+ return 0;
+}
+
+static void vp4_dc_predictor_reset(VP4Predictor *p)
+{
+ p->dc = 0;
+ p->type = VP4_DC_UNDEFINED;
+}
+
+static void vp4_dc_pred_before(const Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x)
+{
+ int i, j;
+
+ for (i = 0; i < 4; i++)
+ dc_pred[0][i + 1] = s->dc_pred_row[sb_x * 4 + i];
+
+ for (j = 1; j < 5; j++)
+ for (i = 0; i < 4; i++)
+ vp4_dc_predictor_reset(&dc_pred[j][i + 1]);
+}
+
+static void vp4_dc_pred_after(Vp3DecodeContext *s, VP4Predictor dc_pred[6][6], int sb_x)
+{
+ int i;
+
+ for (i = 0; i < 4; i++)
+ s->dc_pred_row[sb_x * 4 + i] = dc_pred[4][i + 1];
+
+ for (i = 1; i < 5; i++)
+ dc_pred[i][0] = dc_pred[i][4];
+}
+
+/* note: dc_pred points to the current block */
+static int vp4_dc_pred(const Vp3DecodeContext *s, const VP4Predictor * dc_pred, const int * last_dc, int type, int plane)
+{
+ int count = 0;
+ int dc = 0;
+
+ if (dc_pred[-6].type == type) {
+ dc += dc_pred[-6].dc;
+ count++;
+ }
+
+ if (dc_pred[6].type == type) {
+ dc += dc_pred[6].dc;
+ count++;
+ }
+
+ if (count != 2 && dc_pred[-1].type == type) {
+ dc += dc_pred[-1].dc;
+ count++;
+ }
+
+ if (count != 2 && dc_pred[1].type == type) {
+ dc += dc_pred[1].dc;
+ count++;
+ }
+
+ /* using division instead of shift to correctly handle negative values */
+ return count == 2 ? dc / 2 : last_dc[type];
+}
+
+static void vp4_set_tokens_base(Vp3DecodeContext *s)
+{
+ int plane, i;
+ int16_t *base = s->dct_tokens_base;
+ for (plane = 0; plane < 3; plane++) {
+ for (i = 0; i < 64; i++) {
+ s->dct_tokens[plane][i] = base;
+ base += s->fragment_width[!!plane] * s->fragment_height[!!plane];
+ }
+ }
+}
+
+static int vp4_unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)
+{
+ int i, j;
+ int dc_y_table;
+ int dc_c_table;
+ int ac_y_table;
+ int ac_c_table;
+ VLC *tables[2][64];
+ int plane, sb_y, sb_x;
+ int eob_tracker[64];
+ VP4Predictor dc_pred[6][6];
+ int last_dc[NB_VP4_DC_TYPES];
+
+ if (get_bits_left(gb) < 16)
+ return AVERROR_INVALIDDATA;
+
+ /* fetch the DC table indexes */
+ dc_y_table = get_bits(gb, 4);
+ dc_c_table = get_bits(gb, 4);
+
+ ac_y_table = get_bits(gb, 4);
+ ac_c_table = get_bits(gb, 4);
+
+ /* build tables of DC/AC VLC tables */
+
+ tables[0][0] = &s->dc_vlc[dc_y_table];
+ tables[1][0] = &s->dc_vlc[dc_c_table];
+ for (i = 1; i <= 5; i++) {
+ tables[0][i] = &s->ac_vlc_1[ac_y_table];
+ tables[1][i] = &s->ac_vlc_1[ac_c_table];
+ }
+ for (i = 6; i <= 14; i++) {
+ tables[0][i] = &s->ac_vlc_2[ac_y_table];
+ tables[1][i] = &s->ac_vlc_2[ac_c_table];
+ }
+ for (i = 15; i <= 27; i++) {
+ tables[0][i] = &s->ac_vlc_3[ac_y_table];
+ tables[1][i] = &s->ac_vlc_3[ac_c_table];
+ }
+ for (i = 28; i <= 63; i++) {
+ tables[0][i] = &s->ac_vlc_4[ac_y_table];
+ tables[1][i] = &s->ac_vlc_4[ac_c_table];
+ }
+
+ vp4_set_tokens_base(s);
+
+ memset(last_dc, 0, sizeof(last_dc));
+
+ for (plane = 0; plane < ((s->avctx->flags & AV_CODEC_FLAG_GRAY) ? 1 : 3); plane++) {
+ memset(eob_tracker, 0, sizeof(eob_tracker));
+
+ /* initialise dc prediction */
+ for (i = 0; i < s->fragment_width[!!plane]; i++)
+ vp4_dc_predictor_reset(&s->dc_pred_row[i]);
+
+ for (j = 0; j < 6; j++)
+ for (i = 0; i < 6; i++)
+ vp4_dc_predictor_reset(&dc_pred[j][i]);
+
+ for (sb_y = 0; sb_y * 4 < s->fragment_height[!!plane]; sb_y++) {
+ for (sb_x = 0; sb_x *4 < s->fragment_width[!!plane]; sb_x++) {
+ vp4_dc_pred_before(s, dc_pred, sb_x);
+ for (j = 0; j < 16; j++) {
+ int hx = hilbert_offset[j][0];
+ int hy = hilbert_offset[j][1];
+ int x = 4 * sb_x + hx;
+ int y = 4 * sb_y + hy;
+ VP4Predictor *this_dc_pred = &dc_pred[hy + 1][hx + 1];
+ int fragment, dc_block_type;
+
+ if (x >= s->fragment_width[!!plane] || y >= s->fragment_height[!!plane])
+ continue;
+
+ fragment = s->fragment_start[plane] + y * s->fragment_width[!!plane] + x;
+
+ if (s->all_fragments[fragment].coding_method == MODE_COPY)
+ continue;
+
+ if (vp4_unpack_vlcs(s, gb, tables[!!plane], plane, eob_tracker, fragment) < 0)
+ return -1;
+
+ dc_block_type = vp4_pred_block_type_map[s->all_fragments[fragment].coding_method];
+
+ s->all_fragments[fragment].dc +=
+ vp4_dc_pred(s, this_dc_pred, last_dc, dc_block_type, plane);
+
+ this_dc_pred->type = dc_block_type,
+ this_dc_pred->dc = last_dc[dc_block_type] = s->all_fragments[fragment].dc;
+ }
+ vp4_dc_pred_after(s, dc_pred, sb_x);
+ }
+ }
+ }
+
+ vp4_set_tokens_base(s);
+
+ return 0;
+}
+#endif
+
/*
* This function reverses the DC prediction for each coded fragment in
* the frame. Much of this function is adapted directly from the original
@@ -1500,6 +1946,99 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment,
ff_thread_await_progress(ref_frame, ref_row, 0);
}
+#if CONFIG_VP4_DECODER
+/**
+ * @return non-zero if temp (edge_emu_buffer) was populated
+ */
+static int vp4_mc_loop_filter(Vp3DecodeContext *s, int plane, int motion_x, int motion_y, int bx, int by,
+ uint8_t * motion_source, int stride, int src_x, int src_y, uint8_t *temp)
+{
+ int motion_shift = plane ? 4 : 2;
+ int subpel_mask = plane ? 3 : 1;
+ int *bounding_values = s->bounding_values_array + 127;
+
+ int i;
+ int x, y;
+ int x2, y2;
+ int x_subpel, y_subpel;
+ int x_offset, y_offset;
+
+ int block_width = plane ? 8 : 16;
+ int plane_width = s->width >> (plane && s->chroma_x_shift);
+ int plane_height = s->height >> (plane && s->chroma_y_shift);
+
+#define loop_stride 12
+ uint8_t loop[12 * loop_stride];
+
+ /* using division instead of shift to correctly handle negative values */
+ x = 8 * bx + motion_x / motion_shift;
+ y = 8 * by + motion_y / motion_shift;
+
+ x_subpel = motion_x & subpel_mask;
+ y_subpel = motion_y & subpel_mask;
+
+ if (x_subpel || y_subpel) {
+ x--;
+ y--;
+
+ if (x_subpel)
+ x = FFMIN(x, x + FFSIGN(motion_x));
+
+ if (y_subpel)
+ y = FFMIN(y, y + FFSIGN(motion_y));
+
+ x2 = x + block_width;
+ y2 = y + block_width;
+
+ if (x2 < 0 || x2 >= plane_width || y2 < 0 || y2 >= plane_height)
+ return 0;
+
+ x_offset = (-(x + 2) & 7) + 2;
+ y_offset = (-(y + 2) & 7) + 2;
+
+ if (x_offset > 8 + x_subpel && y_offset > 8 + y_subpel)
+ return 0;
+
+ s->vdsp.emulated_edge_mc(loop, motion_source - stride - 1,
+ loop_stride, stride,
+ 12, 12, src_x - 1, src_y - 1,
+ plane_width,
+ plane_height);
+
+ if (x_offset <= 8 + x_subpel)
+ ff_vp3dsp_h_loop_filter_12(loop + x_offset, loop_stride, bounding_values);
+
+ if (y_offset <= 8 + y_subpel)
+ ff_vp3dsp_v_loop_filter_12(loop + y_offset*loop_stride, loop_stride, bounding_values);
+
+ } else {
+
+ x_offset = -x & 7;
+ y_offset = -y & 7;
+
+ if (!x_offset && !y_offset)
+ return 0;
+
+ s->vdsp.emulated_edge_mc(loop, motion_source - stride - 1,
+ loop_stride, stride,
+ 12, 12, src_x - 1, src_y - 1,
+ plane_width,
+ plane_height);
+
+ if (x_offset)
+ s->vp3dsp.h_loop_filter(loop + loop_stride + x_offset + 1, loop_stride, bounding_values);
+
+ if (y_offset)
+ s->vp3dsp.v_loop_filter(loop + (y_offset + 1)*loop_stride + 1, loop_stride, bounding_values);
+ }
+
+ for (i = 0; i < 9; i++)
+ memcpy(temp + i*stride, loop + (i + 1) * loop_stride + 1, 9);
+
+ return 1;
+}
+#endif
+
/*
* Perform the final rendering for a particular slice of data.
* The slice number ranges from 0..(c_superblock_height - 1).
@@ -1585,8 +2124,15 @@ static void render_slice(Vp3DecodeContext *s, int slice)
if ((s->all_fragments[i].coding_method > MODE_INTRA) &&
(s->all_fragments[i].coding_method != MODE_USING_GOLDEN)) {
int src_x, src_y;
+ int standard_mc = 1;
motion_x = motion_val[fragment][0];
motion_y = motion_val[fragment][1];
+#if CONFIG_VP4_DECODER
+ if (plane && s->version >= 2) {
+ motion_x = (motion_x >> 1) | (motion_x & 1);
+ motion_y = (motion_y >> 1) | (motion_y & 1);
+ }
+#endif
src_x = (motion_x >> 1) + 8 * x;
src_y = (motion_y >> 1) + 8 * y;
@@ -1597,9 +2143,22 @@ static void render_slice(Vp3DecodeContext *s, int slice)
motion_halfpel_index |= (motion_y & 0x01) << 1;
motion_source += ((motion_y >> 1) * stride);
- if (src_x < 0 || src_y < 0 ||
+#if CONFIG_VP4_DECODER
+ if (s->version >= 2) {
+ uint8_t *temp = s->edge_emu_buffer;
+ if (stride < 0)
+ temp -= 8 * stride;
+ if (vp4_mc_loop_filter(s, plane, motion_val[fragment][0], motion_val[fragment][1], x, y, motion_source, stride, src_x, src_y, temp)) {
+ motion_source = temp;
+ standard_mc = 0;
+ }
+ }
+#endif
+
+ if (standard_mc && (
+ src_x < 0 || src_y < 0 ||
src_x + 9 >= plane_width ||
- src_y + 9 >= plane_height) {
+ src_y + 9 >= plane_height)) {
uint8_t *temp = s->edge_emu_buffer;
if (stride < 0)
temp -= 8 * stride;
@@ -1665,7 +2224,7 @@ static void render_slice(Vp3DecodeContext *s, int slice)
}
// Filter up to the last row in the superblock row
- if (!s->skip_loop_filter)
+ if (s->version < 2 && !s->skip_loop_filter)
apply_loop_filter(s, plane, 4 * sb_y - !!sb_y,
FFMIN(4 * sb_y + 3, fragment_height - 1));
}
@@ -1694,7 +2253,8 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
y_fragment_count = s->fragment_width[0] * s->fragment_height[0];
c_fragment_count = s->fragment_width[1] * s->fragment_height[1];
- s->superblock_coding = av_mallocz(s->superblock_count);
+ /* superblock_coding is used by unpack_superblocks (VP3/Theora) and vp4_unpack_macroblocks (VP4) */
+ s->superblock_coding = av_mallocz(FFMAX(s->superblock_count, s->yuv_macroblock_count));
s->all_fragments = av_mallocz_array(s->fragment_count, sizeof(Vp3Fragment));
s-> kf_coded_fragment_list = av_mallocz_array(s->fragment_count, sizeof(int));
@@ -1710,10 +2270,13 @@ static av_cold int allocate_tables(AVCodecContext *avctx)
s->superblock_fragments = av_mallocz_array(s->superblock_count, 16 * sizeof(int));
s->macroblock_coding = av_mallocz(s->macroblock_count + 1);
+ s->dc_pred_row = av_malloc_array(s->y_superblock_width * 4, sizeof(*s->dc_pred_row));
+
if (!s->superblock_coding || !s->all_fragments ||
!s->dct_tokens_base || !s->kf_coded_fragment_list ||
!s->nkf_coded_fragment_list ||
!s->superblock_fragments || !s->macroblock_coding ||
+ !s->dc_pred_row ||
!s->motion_val[0] || !s->motion_val[1]) {
vp3_decode_end(avctx);
return -1;
@@ -1747,6 +2310,9 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
int c_width;
int c_height;
int y_fragment_count, c_fragment_count;
+#if CONFIG_VP4_DECODER
+ int j;
+#endif
ret = init_frames(s);
if (ret < 0)
@@ -1754,7 +2320,9 @@ 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', '4', '0'))
+ s->version = 3;
+ else if (avctx->codec_tag == MKTAG('V', 'P', '3', '0'))
s->version = 0;
else
s->version = 1;
@@ -1803,6 +2371,10 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
s->macroblock_width = (s->width + 15) / 16;
s->macroblock_height = (s->height + 15) / 16;
s->macroblock_count = s->macroblock_width * s->macroblock_height;
+ s->c_macroblock_width = (c_width + 15) / 16;
+ s->c_macroblock_height = (c_height + 15) / 16;
+ s->c_macroblock_count = s->c_macroblock_width * s->c_macroblock_height;
+ s->yuv_macroblock_count = s->macroblock_count + 2 * s->c_macroblock_count;
s->fragment_width[0] = s->width / FRAGMENT_PIXELS;
s->fragment_height[0] = s->height / FRAGMENT_PIXELS;
@@ -1818,12 +2390,13 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
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->coded_dc_scale_factor[0][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_y_dc_scale_factor[i];
+ s->coded_dc_scale_factor[1][i] = s->version < 2 ? vp31_dc_scale_factor[i] : vp4_uv_dc_scale_factor[i];
+ s->coded_ac_scale_factor[i] = s->version < 2 ? vp31_ac_scale_factor[i] : vp4_ac_scale_factor[i];
+ s->base_matrix[0][i] = s->version < 2 ? vp31_intra_y_dequant[i] : vp4_generic_dequant[i];
+ s->base_matrix[1][i] = s->version < 2 ? vp31_intra_c_dequant[i] : vp4_generic_dequant[i];
+ s->base_matrix[2][i] = s->version < 2 ? vp31_inter_dequant[i] : vp4_generic_dequant[i];
+ s->filter_limit_values[i] = s->version < 2 ? vp31_filter_limit_values[i] : vp4_filter_limit_values[i];
}
for (inter = 0; inter < 2; inter++) {
@@ -1836,6 +2409,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
}
/* init VLC tables */
+ if (s->version < 2) {
for (i = 0; i < 16; i++) {
/* DC histograms */
init_vlc(&s->dc_vlc[i], 11, 32,
@@ -1862,6 +2436,36 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
&ac_bias_3[i][0][1], 4, 2,
&ac_bias_3[i][0][0], 4, 2, 0);
}
+#if CONFIG_VP4_DECODER
+ } else { /* version >= 2 */
+ for (i = 0; i < 16; i++) {
+ /* DC histograms */
+ init_vlc(&s->dc_vlc[i], 11, 32,
+ &vp4_dc_bias[i][0][1], 4, 2,
+ &vp4_dc_bias[i][0][0], 4, 2, 0);
+
+ /* group 1 AC histograms */
+ init_vlc(&s->ac_vlc_1[i], 11, 32,
+ &vp4_ac_bias_0[i][0][1], 4, 2,
+ &vp4_ac_bias_0[i][0][0], 4, 2, 0);
+
+ /* group 2 AC histograms */
+ init_vlc(&s->ac_vlc_2[i], 11, 32,
+ &vp4_ac_bias_1[i][0][1], 4, 2,
+ &vp4_ac_bias_1[i][0][0], 4, 2, 0);
+
+ /* group 3 AC histograms */
+ init_vlc(&s->ac_vlc_3[i], 11, 32,
+ &vp4_ac_bias_2[i][0][1], 4, 2,
+ &vp4_ac_bias_2[i][0][0], 4, 2, 0);
+
+ /* group 4 AC histograms */
+ init_vlc(&s->ac_vlc_4[i], 11, 32,
+ &vp4_ac_bias_3[i][0][1], 4, 2,
+ &vp4_ac_bias_3[i][0][0], 4, 2, 0);
+ }
+#endif
+ }
} else {
for (i = 0; i < 16; i++) {
/* DC histograms */
@@ -1912,6 +2516,20 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx)
&motion_vector_vlc_table[0][1], 2, 1,
&motion_vector_vlc_table[0][0], 2, 1, 0);
+#if CONFIG_VP4_DECODER
+ for (j = 0; j < 2; j++)
+ for (i = 0; i < 7; i++)
+ init_vlc(&s->vp4_mv_vlc[j][i], 6, 63,
+ &vp4_mv_vlc[j][i][0][1], 4, 2,
+ &vp4_mv_vlc[j][i][0][0], 4, 2, 0);
+
+ /* version >= 2 */
+ for (i = 0; i < 2; i++)
+ init_vlc(&s->block_pattern_vlc[i], 3, 14,
+ &vp4_block_pattern_vlc[i][0][1], 2, 1,
+ &vp4_block_pattern_vlc[i][0][0], 2, 1, 0);
+#endif
+
return allocate_tables(avctx);
vlc_fail:
@@ -2135,6 +2753,29 @@ static int vp3_decode_frame(AVCodecContext *avctx,
av_log(s->avctx, AV_LOG_ERROR,
"Warning, unsupported keyframe coding type?!\n");
skip_bits(&gb, 2); /* reserved? */
+
+#if CONFIG_VP4_DECODER
+ if (s->version >= 2) {
+ int mb_height, mb_width;
+ int mb_width_mul, mb_width_div, mb_height_mul, mb_height_div;
+
+ mb_height = get_bits(&gb, 8);
+ mb_width = get_bits(&gb, 8);
+ if (mb_height != s->macroblock_height ||
+ mb_width != s->macroblock_width)
+ avpriv_request_sample(s->avctx, "macroblock dimension mismatch");
+
+ mb_width_mul = get_bits(&gb, 5);
+ mb_width_div = get_bits(&gb, 3);
+ mb_height_mul = get_bits(&gb, 5);
+ mb_height_div = get_bits(&gb, 3);
+ if (mb_width_mul != 1 || mb_width_div != 1 || mb_height_mul != 1 || mb_height_div != 1)
+ avpriv_request_sample(s->avctx, "unexpected macroblock dimension multipler/divider");
+
+ if (get_bits(&gb, 2))
+ avpriv_request_sample(s->avctx, "unknown bits");
+ }
+#endif
}
} else {
if (!s->golden_frame.f->data[0]) {
@@ -2156,10 +2797,19 @@ static int vp3_decode_frame(AVCodecContext *avctx,
memset(s->all_fragments, 0, s->fragment_count * sizeof(Vp3Fragment));
ff_thread_finish_setup(avctx);
+ if (s->version < 2) {
if (unpack_superblocks(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n");
goto error;
}
+#if CONFIG_VP4_DECODER
+ } else {
+ if (vp4_unpack_macroblocks(s, &gb)) {
+ av_log(s->avctx, AV_LOG_ERROR, "error in vp4_unpack_macroblocks\n");
+ goto error;
+ }
+#endif
+ }
if (unpack_modes(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n");
goto error;
@@ -2172,10 +2822,20 @@ static int vp3_decode_frame(AVCodecContext *avctx,
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_block_qpis\n");
goto error;
}
+
+ if (s->version < 2) {
if (unpack_dct_coeffs(s, &gb)) {
av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n");
goto error;
}
+#if CONFIG_VP4_DECODER
+ } else {
+ if (vp4_unpack_dct_coeffs(s, &gb)) {
+ av_log(s->avctx, AV_LOG_ERROR, "error in vp4_unpack_dct_coeffs\n");
+ goto error;
+ }
+#endif
+ }
for (i = 0; i < 3; i++) {
int height = s->height >> (i && s->chroma_y_shift);
@@ -2190,6 +2850,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
render_slice(s, i);
// filter the last row
+ if (s->version < 2)
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);
@@ -2274,6 +2935,7 @@ static int vp3_init_thread_copy(AVCodecContext *avctx)
s->motion_val[0] = NULL;
s->motion_val[1] = NULL;
s->edge_emu_buffer = NULL;
+ s->dc_pred_row = NULL;
return init_frames(s);
}
@@ -2422,7 +3084,8 @@ static int theora_decode_tables(AVCodecContext *avctx, GetBitContext *gb)
n = 16;
/* dc scale factor table */
for (i = 0; i < 64; i++)
- s->coded_dc_scale_factor[i] = get_bits(gb, n);
+ s->coded_dc_scale_factor[0][i] =
+ s->coded_dc_scale_factor[1][i] = get_bits(gb, n);
if (s->theora >= 0x030200)
matrices = get_bits(gb, 9) + 1;
@@ -2608,3 +3271,21 @@ AVCodec ff_vp3_decoder = {
.init_thread_copy = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context),
};
+
+#if CONFIG_VP4_DECODER
+AVCodec ff_vp4_decoder = {
+ .name = "vp4",
+ .long_name = NULL_IF_CONFIG_SMALL("On2 VP4"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_VP4,
+ .priv_data_size = sizeof(Vp3DecodeContext),
+ .init = vp3_decode_init,
+ .close = vp3_decode_end,
+ .decode = vp3_decode_frame,
+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DRAW_HORIZ_BAND |
+ AV_CODEC_CAP_FRAME_THREADS,
+ .flush = vp3_decode_flush,
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp3_init_thread_copy),
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(vp3_update_thread_context),
+};
+#endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp3data.h b/chromium/third_party/ffmpeg/libavcodec/vp3data.h
index c82b1b3a864..d520a10c768 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp3data.h
+++ b/chromium/third_party/ffmpeg/libavcodec/vp3data.h
@@ -198,11 +198,10 @@ static const int8_t fixed_motion_vector_table[64] = {
};
/* only tokens 0..6 indicate eob runs */
-static const uint8_t eob_run_base[7] = {
- 1, 2, 3, 4, 8, 16, 0
-};
-static const uint8_t eob_run_get_bits[7] = {
- 0, 0, 0, 2, 3, 4, 12
+static const struct {
+ uint8_t base, bits;
+} eob_run_table[7] = {
+ {1, 0}, {2, 0}, {3, 0}, {4, 2}, {8, 3}, {16, 4}, {0, 12}
};
static const uint8_t zero_run_base[32] = {
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp4data.h b/chromium/third_party/ffmpeg/libavcodec/vp4data.h
new file mode 100644
index 00000000000..69a009eff13
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavcodec/vp4data.h
@@ -0,0 +1,1186 @@
+/*
+ * Copyright (C) 2019 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
+ * VP4 video decoder
+ */
+
+#ifndef AVCODEC_VP4DATA_H
+#define AVCODEC_VP4DATA_H
+
+#include <stdint.h>
+
+static const uint8_t vp4_generic_dequant[64] = {
+ 16, 17, 18, 20, 22, 24, 26, 28,
+ 17, 18, 20, 22, 24, 26, 28, 32,
+ 18, 20, 22, 24, 26, 28, 32, 36,
+ 20, 22, 24, 26, 28, 32, 36, 40,
+ 22, 24, 26, 28, 32, 36, 40, 44,
+ 24, 26, 28, 32, 36, 40, 44, 48,
+ 26, 28, 32, 36, 40, 44, 48, 52,
+ 28, 32, 36, 40, 44, 48, 52, 56
+};
+
+static const uint8_t vp4_y_dc_scale_factor[64] = {
+ 180, 180, 180, 180, 180, 180, 175, 170,
+ 165, 160, 157, 155, 152, 150, 147, 145,
+ 142, 140, 137, 135, 132, 130, 127, 125,
+ 122, 120, 117, 115, 112, 110, 107, 105,
+ 102, 100, 97, 95, 92, 90, 87, 85,
+ 82, 80, 77, 75, 72, 70, 67, 65,
+ 62, 60, 57, 55, 52, 50, 47, 45,
+ 42, 40, 37, 35, 32, 30, 27, 25
+};
+
+static const uint8_t vp4_uv_dc_scale_factor[64] = {
+ 150, 150, 150, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 150, 147, 145,
+ 142, 140, 137, 135, 132, 130, 127, 125,
+ 122, 120, 117, 115, 112, 110, 107, 105,
+ 102, 100, 97, 95, 92, 90, 87, 85,
+ 82, 80, 77, 75, 72, 70, 67, 65,
+ 62, 60, 57, 55, 52, 50, 47, 45,
+ 42, 40, 37, 35, 32, 30, 27, 25
+};
+
+static const uint16_t vp4_ac_scale_factor[64] = {
+ 500, 475, 450, 430, 410, 390, 370, 350,
+ 330, 315, 300, 285, 270, 260, 250, 240,
+ 230, 220, 210, 200, 190, 185, 180, 170,
+ 160, 150, 143, 135, 128, 120, 113, 106,
+ 100, 94, 90, 85, 80, 75, 70, 66,
+ 62, 57, 52, 49, 45, 41, 38, 35,
+ 33, 30, 27, 24, 22, 20, 18, 16,
+ 14, 12, 10, 9, 7, 6, 4, 1
+};
+
+static const uint8_t vp4_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,
+ 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+static const uint8_t vp4_block_pattern_table_selector[14] = {
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1
+};
+
+static const uint8_t vp4_block_pattern_vlc[2][14][2] = {
+ {
+ { 0x0, 3 }, { 0xf, 4 }, { 0x9, 4 }, { 0x2, 3 },
+ { 0xd, 4 }, { 0xe, 5 }, { 0xb, 4 }, { 0x1, 3 },
+ { 0xf, 5 }, { 0x8, 4 }, { 0x6, 4 }, { 0xe, 4 },
+ { 0xc, 4 }, { 0xa, 4 }
+ },
+ {
+ { 0x7, 4 }, { 0xa, 4 }, { 0x9, 4 }, { 0xc, 4 },
+ { 0x8, 4 }, { 0xd, 5 }, { 0x0, 3 }, { 0xe, 4 },
+ { 0xc, 5 }, { 0xd, 4 }, { 0x1, 3 }, { 0xb, 4 },
+ { 0xf, 4 }, { 0x2, 3 }
+ }
+};
+
+static const uint8_t vp4_mv_table_selector[32] = {
+ 0, 1, 2, 2, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+};
+
+static const uint16_t vp4_mv_vlc[2][7][63][2] = {
+ { /* x-axis tables */
+ {
+ { 0x6A, 7 }, { 0x11A, 9 }, { 0x18E, 9 }, { 0x237, 10 },
+ { 0x4A, 8 }, { 0x236, 10 }, { 0x7A, 8 }, { 0xD6, 9 },
+ { 0x7E, 8 }, { 0x1FD, 10 }, { 0x8C, 8 }, { 0xD7, 9 },
+ { 0x87, 8 }, { 0x183, 9 }, { 0x3C, 7 }, { 0x61, 7 },
+ { 0x47, 7 }, { 0x69, 8 }, { 0x40, 7 }, { 0x48, 8 },
+ { 0x49, 7 }, { 0x86, 8 }, { 0x13, 6 }, { 0xD2, 8 },
+ { 0x1C, 6 }, { 0x42, 7 }, { 0x25, 6 }, { 0x1B, 6 },
+ { 0x13, 5 }, { 0x5, 4 }, { 0x0, 2 }, { 0x7, 3 },
+ { 0x5, 3 }, { 0x1B, 5 }, { 0x19, 5 }, { 0x19, 6 },
+ { 0x8, 5 }, { 0x45, 7 }, { 0x1D, 6 }, { 0xC6, 8 },
+ { 0x68, 7 }, { 0x90, 8 }, { 0x41, 7 }, { 0x4B, 8 },
+ { 0x31, 7 }, { 0x18F, 9 }, { 0x62, 7 }, { 0x3E, 7 },
+ { 0x44, 7 }, { 0x68, 8 }, { 0x30, 7 }, { 0x182, 9 },
+ { 0xC0, 8 }, { 0x1A7, 9 }, { 0x91, 8 }, { 0x92, 9 },
+ { 0x7B, 8 }, { 0xFF, 9 }, { 0x1A6, 9 }, { 0x1FC, 10 },
+ { 0x6A, 8 }, { 0x93, 9 }, { 0x6B, 7 }
+ },
+ {
+ { 0x39, 7 }, { 0x259, 10 }, { 0x1B, 8 }, { 0x1D1, 10 },
+ { 0x137, 9 }, { 0x1D0, 10 }, { 0x1A, 8 }, { 0x1B5, 10 },
+ { 0x1D, 8 }, { 0x4BC, 11 }, { 0x6C, 8 }, { 0x38, 9 },
+ { 0x71, 8 }, { 0x2D, 9 }, { 0x7D, 8 }, { 0x75, 8 },
+ { 0x19, 7 }, { 0xE9, 9 }, { 0x37, 7 }, { 0x15, 8 },
+ { 0x1E, 7 }, { 0xDB, 9 }, { 0x4C, 7 }, { 0x70, 8 },
+ { 0xD, 6 }, { 0xC, 7 }, { 0x27, 6 }, { 0x4, 6 },
+ { 0x2, 4 }, { 0x0, 4 }, { 0x5, 3 }, { 0x7, 3 },
+ { 0x6, 3 }, { 0x2, 3 }, { 0x8, 4 }, { 0x24, 6 },
+ { 0xC, 5 }, { 0x3B, 7 }, { 0x1E, 6 }, { 0x9A, 8 },
+ { 0xE, 6 }, { 0x69, 8 }, { 0x4A, 7 }, { 0x12D, 9 },
+ { 0x35, 7 }, { 0xF9, 9 }, { 0x18, 7 }, { 0x7F, 8 },
+ { 0xF, 7 }, { 0xF8, 9 }, { 0x7E, 8 }, { 0x25F, 10 },
+ { 0x68, 8 }, { 0x2C, 9 }, { 0x14, 8 }, { 0x258, 10 },
+ { 0x136, 9 }, { 0x4BD, 11 }, { 0x12E, 9 }, { 0x1B4, 10 },
+ { 0x17, 8 }, { 0x39, 9 }, { 0x1F, 7 }
+ },
+ {
+ { 0x29, 7 }, { 0x3CB, 10 }, { 0x1F5, 9 }, { 0x263, 10 },
+ { 0x1F4, 9 }, { 0x3DA, 10 }, { 0x50, 8 }, { 0x260, 10 },
+ { 0x1EC, 9 }, { 0x3D3, 10 }, { 0x109, 9 }, { 0x3D2, 10 },
+ { 0x51, 8 }, { 0x792, 11 }, { 0xF3, 8 }, { 0x9A, 8 },
+ { 0xF7, 8 }, { 0x132, 9 }, { 0xC1, 8 }, { 0x1E8, 9 },
+ { 0x2A, 7 }, { 0x85, 8 }, { 0x61, 7 }, { 0x1F7, 9 },
+ { 0x78, 7 }, { 0xC7, 8 }, { 0x23, 6 }, { 0x7C, 7 },
+ { 0x12, 5 }, { 0xB, 5 }, { 0xE, 4 }, { 0xD, 4 },
+ { 0x0, 2 }, { 0x5, 3 }, { 0x3, 3 }, { 0x4, 4 },
+ { 0x19, 5 }, { 0x20, 6 }, { 0x3F, 6 }, { 0x43, 7 },
+ { 0x62, 7 }, { 0x9F, 8 }, { 0x4E, 7 }, { 0x181, 9 },
+ { 0x2B, 7 }, { 0x137, 9 }, { 0xF5, 8 }, { 0x89, 8 },
+ { 0xC6, 8 }, { 0x262, 10 }, { 0x88, 8 }, { 0x3C8, 10 },
+ { 0x1F6, 9 }, { 0x3CA, 10 }, { 0x9E, 8 }, { 0x261, 10 },
+ { 0x136, 9 }, { 0x108, 9 }, { 0x133, 9 }, { 0x793, 11 },
+ { 0x180, 9 }, { 0x3DB, 10 }, { 0x45, 7 }
+ },
+ {
+ { 0x1, 6 }, { 0x1C7, 9 }, { 0x67, 8 }, { 0xB5, 9 },
+ { 0x66, 8 }, { 0x139, 9 }, { 0x99, 8 }, { 0xB4, 9 },
+ { 0xC3, 8 }, { 0x130, 9 }, { 0x0, 7 }, { 0x131, 9 },
+ { 0x9E, 8 }, { 0xB7, 9 }, { 0x2C, 7 }, { 0x1, 7 },
+ { 0x28, 7 }, { 0x138, 9 }, { 0x4B, 7 }, { 0x31, 8 },
+ { 0x60, 7 }, { 0x91, 8 }, { 0x3, 6 }, { 0x9D, 8 },
+ { 0x17, 6 }, { 0x4D, 7 }, { 0x31, 6 }, { 0x70, 7 },
+ { 0x7, 5 }, { 0x3A, 6 }, { 0x7, 4 }, { 0x2, 4 },
+ { 0xB, 4 }, { 0x1, 4 }, { 0xF, 4 }, { 0x8, 4 },
+ { 0xD, 4 }, { 0x4, 4 }, { 0xA, 4 }, { 0xD, 5 },
+ { 0x19, 5 }, { 0x2, 6 }, { 0x3B, 6 }, { 0x4A, 7 },
+ { 0x15, 6 }, { 0xC2, 8 }, { 0x18, 6 }, { 0x32, 7 },
+ { 0x72, 7 }, { 0x1C6, 9 }, { 0x29, 7 }, { 0x1C5, 9 },
+ { 0x49, 7 }, { 0x121, 9 }, { 0x1B, 7 }, { 0x30, 8 },
+ { 0x1A, 7 }, { 0x1C4, 9 }, { 0x9F, 8 }, { 0xB6, 9 },
+ { 0x19, 7 }, { 0x120, 9 }, { 0x73, 7 }
+ },
+ {
+ { 0x23, 6 }, { 0x1C8, 9 }, { 0x43, 8 }, { 0x110, 9 },
+ { 0xC, 7 }, { 0x153, 9 }, { 0x22, 7 }, { 0x111, 9 },
+ { 0xF, 7 }, { 0x42, 8 }, { 0x23, 7 }, { 0x1C9, 9 },
+ { 0x2A, 7 }, { 0x1B, 8 }, { 0x73, 7 }, { 0x45, 7 },
+ { 0x6E, 7 }, { 0x89, 8 }, { 0x6C, 7 }, { 0x1A, 8 },
+ { 0x6F, 7 }, { 0xB6, 8 }, { 0xB, 6 }, { 0xE5, 8 },
+ { 0x25, 6 }, { 0x20, 7 }, { 0x29, 6 }, { 0x4D, 7 },
+ { 0x2, 5 }, { 0x14, 6 }, { 0x1A, 5 }, { 0x17, 5 },
+ { 0x1E, 5 }, { 0x27, 6 }, { 0x18, 5 }, { 0x28, 6 },
+ { 0x1F, 5 }, { 0x0, 5 }, { 0x6, 4 }, { 0x10, 5 },
+ { 0x7, 4 }, { 0xB, 5 }, { 0x3, 4 }, { 0x4, 5 },
+ { 0x1D, 5 }, { 0x2C, 6 }, { 0x19, 5 }, { 0x2B, 6 },
+ { 0x9, 5 }, { 0x55, 7 }, { 0x38, 6 }, { 0xE, 7 },
+ { 0x24, 6 }, { 0xA8, 8 }, { 0xA, 6 }, { 0x99, 8 },
+ { 0x5A, 7 }, { 0x98, 8 }, { 0x6D, 7 }, { 0x152, 9 },
+ { 0x2B, 7 }, { 0xB7, 8 }, { 0x1, 5 }
+ },
+ {
+ { 0x3D, 6 }, { 0xB1, 8 }, { 0xDD, 8 }, { 0x1F6, 9 },
+ { 0xC5, 8 }, { 0x188, 9 }, { 0x37, 7 }, { 0x3F, 8 },
+ { 0x1E, 7 }, { 0x189, 9 }, { 0xF, 7 }, { 0x3E, 8 },
+ { 0x6A, 7 }, { 0x1F7, 9 }, { 0x61, 7 }, { 0x79, 7 },
+ { 0x18, 6 }, { 0xB0, 8 }, { 0xE, 6 }, { 0xB3, 8 },
+ { 0xC, 6 }, { 0xDF, 8 }, { 0x6, 6 }, { 0xDC, 8 },
+ { 0x19, 6 }, { 0xDE, 8 }, { 0x27, 6 }, { 0xE, 7 },
+ { 0x1A, 6 }, { 0x63, 7 }, { 0xF, 5 }, { 0xE, 5 },
+ { 0x14, 5 }, { 0x7C, 7 }, { 0x36, 6 }, { 0x6B, 7 },
+ { 0x3F, 6 }, { 0x60, 7 }, { 0x8, 5 }, { 0x74, 7 },
+ { 0x9, 5 }, { 0x78, 7 }, { 0x12, 5 }, { 0xD, 6 },
+ { 0x15, 5 }, { 0x2D, 6 }, { 0x2, 4 }, { 0x1C, 5 },
+ { 0x5, 4 }, { 0x3B, 6 }, { 0x0, 4 }, { 0x34, 6 },
+ { 0x19, 5 }, { 0x26, 6 }, { 0x10, 5 }, { 0x75, 7 },
+ { 0x2, 5 }, { 0x36, 7 }, { 0x23, 6 }, { 0xB2, 8 },
+ { 0x22, 6 }, { 0xFA, 8 }, { 0x17, 5 }
+ },
+ {
+ { 0x15, 5 }, { 0xDD, 8 }, { 0x3E, 7 }, { 0x16E, 9 },
+ { 0x4C, 7 }, { 0x12, 8 }, { 0x5D, 7 }, { 0xB6, 8 },
+ { 0x6F, 7 }, { 0x1F1, 9 }, { 0x69, 7 }, { 0x1F0, 9 },
+ { 0x1D, 7 }, { 0x16F, 9 }, { 0x2, 6 }, { 0x6B, 7 },
+ { 0xC, 6 }, { 0xDC, 8 }, { 0x68, 7 }, { 0x9B, 8 },
+ { 0x7D, 7 }, { 0x9A, 8 }, { 0xD, 6 }, { 0x13, 8 },
+ { 0x8, 6 }, { 0xF9, 8 }, { 0x2C, 6 }, { 0x12, 7 },
+ { 0x33, 6 }, { 0x4F, 7 }, { 0xD, 5 }, { 0x5, 5 },
+ { 0x12, 5 }, { 0x3F, 7 }, { 0x32, 6 }, { 0x13, 7 },
+ { 0x3B, 6 }, { 0x5, 6 }, { 0x2F, 6 }, { 0x5A, 7 },
+ { 0x3F, 6 }, { 0x1C, 7 }, { 0x3A, 6 }, { 0x8, 7 },
+ { 0x36, 6 }, { 0x5C, 7 }, { 0x10, 5 }, { 0x0, 5 },
+ { 0xC, 5 }, { 0x4E, 7 }, { 0x3, 5 }, { 0x6A, 7 },
+ { 0xE, 5 }, { 0x3, 6 }, { 0x14, 5 }, { 0x1E, 6 },
+ { 0x1C, 5 }, { 0xF, 6 }, { 0x18, 5 }, { 0x23, 6 },
+ { 0x1E, 5 }, { 0x22, 6 }, { 0x2, 3 }
+ }
+ },
+ { /* y-axis tables */
+ {
+ { 0x52, 7 }, { 0x14C, 9 }, { 0x1FA, 9 }, { 0x124, 9 },
+ { 0x82, 8 }, { 0x29E, 10 }, { 0x8E, 8 }, { 0x24B, 10 },
+ { 0x9C, 8 }, { 0x3F7, 10 }, { 0x86, 8 }, { 0x114, 9 },
+ { 0x83, 8 }, { 0x3A5, 10 }, { 0xFA, 8 }, { 0x4F, 7 },
+ { 0xFB, 8 }, { 0x13B, 9 }, { 0xFC, 8 }, { 0x172, 9 },
+ { 0x44, 7 }, { 0x173, 9 }, { 0x51, 7 }, { 0x87, 8 },
+ { 0x5F, 7 }, { 0xBA, 8 }, { 0x26, 6 }, { 0x5E, 7 },
+ { 0x16, 5 }, { 0x15, 5 }, { 0x6, 3 }, { 0x1, 2 },
+ { 0x0, 2 }, { 0x1C, 5 }, { 0x1E, 5 }, { 0x75, 7 },
+ { 0x3B, 6 }, { 0xFF, 8 }, { 0x25, 6 }, { 0xBB, 8 },
+ { 0x7C, 7 }, { 0x8B, 8 }, { 0x48, 7 }, { 0x171, 9 },
+ { 0x42, 7 }, { 0x14E, 9 }, { 0x46, 7 }, { 0xFE, 8 },
+ { 0x40, 7 }, { 0x13A, 9 }, { 0x93, 8 }, { 0x115, 9 },
+ { 0x8F, 8 }, { 0x3F6, 10 }, { 0x170, 9 }, { 0x29F, 10 },
+ { 0x1D1, 9 }, { 0x24A, 10 }, { 0x1D3, 9 }, { 0x3A4, 10 },
+ { 0x1D0, 9 }, { 0x14D, 9 }, { 0x50, 7 }
+ },
+ {
+ { 0xDE, 8 }, { 0x223, 10 }, { 0x136, 9 }, { 0x7C5, 11 },
+ { 0x12F, 9 }, { 0x4A1, 11 }, { 0x3D7, 10 }, { 0x7AC, 11 },
+ { 0x133, 9 }, { 0x7C4, 11 }, { 0x1B8, 9 }, { 0x222, 10 },
+ { 0x96, 8 }, { 0x251, 10 }, { 0x95, 8 }, { 0x1F0, 9 },
+ { 0xDA, 8 }, { 0x110, 9 }, { 0x9A, 8 }, { 0x360, 10 },
+ { 0xDD, 8 }, { 0x12E, 9 }, { 0x48, 7 }, { 0x92, 8 },
+ { 0x78, 7 }, { 0x98, 8 }, { 0x27, 6 }, { 0x45, 7 },
+ { 0x1A, 5 }, { 0x10, 5 }, { 0x5, 3 }, { 0x0, 2 },
+ { 0x1, 2 }, { 0xE, 4 }, { 0xC, 4 }, { 0x23, 6 },
+ { 0x3F, 6 }, { 0xF4, 8 }, { 0x7D, 7 }, { 0x89, 8 },
+ { 0x7B, 7 }, { 0x1BE, 9 }, { 0xF9, 8 }, { 0x3E3, 10 },
+ { 0xF3, 8 }, { 0x127, 9 }, { 0xDB, 8 }, { 0x1EA, 9 },
+ { 0xD9, 8 }, { 0x6E7, 11 }, { 0x1BF, 9 }, { 0x4A0, 11 },
+ { 0x1B1, 9 }, { 0x6E6, 11 }, { 0x137, 9 }, { 0x7AD, 11 },
+ { 0x126, 9 }, { 0x6C2, 11 }, { 0x132, 9 }, { 0x6C3, 11 },
+ { 0x129, 9 }, { 0x372, 10 }, { 0xF2, 8 }
+ },
+ {
+ { 0x16, 7 }, { 0x9C, 9 }, { 0x13C, 9 }, { 0x9E, 10 },
+ { 0x12B, 9 }, { 0xBA, 10 }, { 0x181, 9 }, { 0x317, 10 },
+ { 0x84, 8 }, { 0x4E, 9 }, { 0x26, 8 }, { 0x316, 10 },
+ { 0x180, 9 }, { 0x5C, 9 }, { 0xC1, 8 }, { 0x2F, 8 },
+ { 0x10, 7 }, { 0x45, 9 }, { 0x12, 7 }, { 0x189, 9 },
+ { 0x24, 7 }, { 0x13D, 9 }, { 0x66, 7 }, { 0x23, 8 },
+ { 0x67, 7 }, { 0xC6, 8 }, { 0x24, 6 }, { 0x4B, 7 },
+ { 0x11, 5 }, { 0x32, 6 }, { 0xD, 4 }, { 0x0, 3 },
+ { 0x7, 3 }, { 0x5, 3 }, { 0x3, 3 }, { 0x3, 4 },
+ { 0x5, 4 }, { 0x20, 6 }, { 0x8, 5 }, { 0x25, 7 },
+ { 0x26, 6 }, { 0x4F, 8 }, { 0x61, 7 }, { 0x2B, 8 },
+ { 0x4E, 7 }, { 0x18A, 9 }, { 0x43, 7 }, { 0x9F, 8 },
+ { 0x14, 7 }, { 0x254, 10 }, { 0x94, 8 }, { 0x310, 10 },
+ { 0x85, 8 }, { 0x311, 10 }, { 0x2A, 8 }, { 0xBB, 10 },
+ { 0x18F, 9 }, { 0x255, 10 }, { 0x9D, 9 }, { 0x9F, 10 },
+ { 0x18E, 9 }, { 0x44, 9 }, { 0x26, 7 }
+ },
+ {
+ { 0x61, 7 }, { 0x12A, 9 }, { 0xD, 8 }, { 0x3BD, 10 },
+ { 0x89, 8 }, { 0x109, 9 }, { 0x18E, 9 }, { 0x210, 10 },
+ { 0x1D3, 9 }, { 0x211, 10 }, { 0x88, 8 }, { 0x19, 9 },
+ { 0x85, 8 }, { 0x18, 9 }, { 0xE8, 8 }, { 0xCE, 8 },
+ { 0x40, 7 }, { 0x119, 9 }, { 0x45, 7 }, { 0x1D2, 9 },
+ { 0x4B, 7 }, { 0x1DD, 9 }, { 0x62, 7 }, { 0x94, 8 },
+ { 0x75, 7 }, { 0xC, 7 }, { 0x27, 6 }, { 0xD, 7 },
+ { 0x2, 5 }, { 0x26, 6 }, { 0x6, 4 }, { 0x1E, 5 },
+ { 0xD, 4 }, { 0x1F, 5 }, { 0x1, 3 }, { 0xA, 4 },
+ { 0x2, 3 }, { 0x7, 4 }, { 0xB, 4 }, { 0x0, 5 },
+ { 0x1C, 5 }, { 0x76, 7 }, { 0x32, 6 }, { 0x7, 7 },
+ { 0x24, 6 }, { 0xC0, 8 }, { 0x7, 6 }, { 0x41, 7 },
+ { 0x2, 6 }, { 0x18F, 9 }, { 0x47, 7 }, { 0x1DC, 9 },
+ { 0x43, 7 }, { 0x12B, 9 }, { 0xCF, 8 }, { 0x118, 9 },
+ { 0xC6, 8 }, { 0x3BC, 10 }, { 0x8D, 8 }, { 0x3BF, 10 },
+ { 0xC1, 8 }, { 0x3BE, 10 }, { 0x66, 7 }
+ },
+ {
+ { 0x7, 6 }, { 0x14D, 9 }, { 0xA0, 8 }, { 0x9E, 9 },
+ { 0xCF, 8 }, { 0x39C, 10 }, { 0xA1, 8 }, { 0x39D, 10 },
+ { 0xAB, 8 }, { 0x1C5, 9 }, { 0x26, 7 }, { 0x14C, 9 },
+ { 0x25, 7 }, { 0x19C, 9 }, { 0x3F, 7 }, { 0xE1, 8 },
+ { 0x66, 7 }, { 0x1CF, 9 }, { 0x3E, 7 }, { 0x1C4, 9 },
+ { 0x72, 7 }, { 0x4E, 8 }, { 0x6, 6 }, { 0xAA, 8 },
+ { 0x1C, 6 }, { 0xE6, 8 }, { 0x32, 6 }, { 0x51, 7 },
+ { 0x3B, 6 }, { 0x5, 6 }, { 0x1F, 5 }, { 0x18, 5 },
+ { 0x2, 4 }, { 0x3A, 6 }, { 0x0, 4 }, { 0x36, 6 },
+ { 0x5, 4 }, { 0x8, 5 }, { 0x8, 4 }, { 0x16, 5 },
+ { 0x9, 4 }, { 0xD, 5 }, { 0x3, 4 }, { 0x2F, 6 },
+ { 0x1E, 5 }, { 0x2E, 6 }, { 0x1A, 5 }, { 0x2B, 6 },
+ { 0xC, 5 }, { 0x24, 7 }, { 0x1E, 6 }, { 0xE0, 8 },
+ { 0x4, 6 }, { 0xA7, 8 }, { 0x54, 7 }, { 0x1C7, 9 },
+ { 0x52, 7 }, { 0x19D, 9 }, { 0x3A, 7 }, { 0x9F, 9 },
+ { 0x3B, 7 }, { 0x1C6, 9 }, { 0x37, 6 }
+ },
+ {
+ { 0x2A, 6 }, { 0x39, 8 }, { 0x25, 7 }, { 0x115, 9 },
+ { 0x24, 7 }, { 0x1FA, 9 }, { 0x2F, 7 }, { 0x114, 9 },
+ { 0x75, 7 }, { 0x38, 8 }, { 0xFC, 8 }, { 0x36, 8 },
+ { 0x1E, 7 }, { 0x1FB, 9 }, { 0x7F, 7 }, { 0x68, 7 },
+ { 0x16, 6 }, { 0x37, 8 }, { 0x1F, 7 }, { 0x5C, 8 },
+ { 0x13, 6 }, { 0x8B, 8 }, { 0x1, 6 }, { 0xFB, 8 },
+ { 0x21, 6 }, { 0x44, 7 }, { 0x2B, 6 }, { 0x6B, 7 },
+ { 0x3B, 6 }, { 0xC, 6 }, { 0x1C, 5 }, { 0x19, 5 },
+ { 0x1, 4 }, { 0x20, 6 }, { 0x16, 5 }, { 0x7C, 7 },
+ { 0xC, 5 }, { 0x74, 7 }, { 0xA, 5 }, { 0x1C, 6 },
+ { 0x12, 5 }, { 0x69, 7 }, { 0xF, 5 }, { 0x6A, 7 },
+ { 0x14, 5 }, { 0x11, 6 }, { 0x1E, 5 }, { 0x17, 5 },
+ { 0x2, 4 }, { 0x31, 6 }, { 0x1B, 5 }, { 0x30, 6 },
+ { 0xD, 5 }, { 0x0, 6 }, { 0x1, 5 }, { 0x1D, 7 },
+ { 0x23, 6 }, { 0x1A, 7 }, { 0x1D, 6 }, { 0x5D, 8 },
+ { 0x10, 6 }, { 0xFA, 8 }, { 0x13, 5 }
+ },
+ {
+ { 0x12, 5 }, { 0x26, 7 }, { 0x41, 7 }, { 0x22, 8 },
+ { 0x1A, 7 }, { 0xA9, 8 }, { 0x4C, 7 }, { 0x1B2, 9 },
+ { 0x5C, 7 }, { 0xA8, 8 }, { 0x58, 7 }, { 0x1B3, 9 },
+ { 0x40, 7 }, { 0x79, 8 }, { 0xC, 6 }, { 0x55, 7 },
+ { 0x1F, 6 }, { 0xD8, 8 }, { 0x76, 7 }, { 0x23, 8 },
+ { 0x5F, 7 }, { 0x78, 8 }, { 0xB, 6 }, { 0x1B, 7 },
+ { 0x2D, 6 }, { 0x10, 7 }, { 0x37, 6 }, { 0x6D, 7 },
+ { 0x32, 6 }, { 0xA, 6 }, { 0x1A, 5 }, { 0x1E, 5 },
+ { 0x1F, 5 }, { 0x2B, 6 }, { 0xD, 5 }, { 0x77, 7 },
+ { 0x31, 6 }, { 0x5D, 7 }, { 0x38, 6 }, { 0x27, 7 },
+ { 0xC, 5 }, { 0xE9, 8 }, { 0x33, 6 }, { 0x5E, 7 },
+ { 0x30, 6 }, { 0x4D, 7 }, { 0xA, 5 }, { 0x21, 6 },
+ { 0x7, 5 }, { 0x3D, 7 }, { 0x39, 6 }, { 0xE8, 8 },
+ { 0xB, 5 }, { 0x59, 7 }, { 0x14, 5 }, { 0x27, 6 },
+ { 0x11, 5 }, { 0x75, 7 }, { 0xE, 5 }, { 0x9, 6 },
+ { 0x8, 5 }, { 0x12, 6 }, { 0x0, 3 }
+ }
+ }
+};
+
+static const uint16_t vp4_dc_bias[16][32][2] = {
+ { /* DC bias table 0 */
+ { 0xC, 5 }, { 0x70, 7 }, { 0x1CA, 9 }, { 0x1CB, 9 },
+ { 0x391, 10 }, { 0x1C9B, 13 }, { 0x3935, 14 }, { 0x71, 7 },
+ { 0x3934, 14 }, { 0xB, 4 }, { 0xF, 4 }, { 0x19, 5 },
+ { 0x2, 4 }, { 0x9, 4 }, { 0x3, 4 }, { 0x1D, 5 },
+ { 0x18, 5 }, { 0x7, 4 }, { 0xD, 4 }, { 0x2, 3 },
+ { 0x0, 3 }, { 0xA, 4 }, { 0x8, 4 }, { 0x1A, 6 },
+ { 0x73, 7 }, { 0x6F, 8 }, { 0xE4C, 12 }, { 0x727, 11 },
+ { 0x392, 10 }, { 0x390, 10 }, { 0x36, 7 }, { 0x6E, 8 }
+ },
+ { /* DC bias table 1 */
+ { 0x11, 5 }, { 0x7A, 7 }, { 0x83, 8 }, { 0x40, 7 },
+ { 0x105, 9 }, { 0x413, 11 }, { 0x410, 11 }, { 0x7B, 7 },
+ { 0x822, 12 }, { 0xE, 4 }, { 0x2, 3 }, { 0x2, 4 },
+ { 0x6, 4 }, { 0xA, 4 }, { 0x7, 4 }, { 0x1F, 5 },
+ { 0x17, 5 }, { 0x9, 4 }, { 0xD, 4 }, { 0x0, 3 },
+ { 0xC, 4 }, { 0x3, 4 }, { 0x3C, 6 }, { 0x2C, 6 },
+ { 0x21, 6 }, { 0x169, 9 }, { 0x412, 11 }, { 0x2D0, 10 },
+ { 0x2D1, 10 }, { 0x823, 12 }, { 0x5B, 7 }, { 0xB5, 8 }
+ },
+ { /* DC bias table 2 */
+ { 0x17, 5 }, { 0x10, 6 }, { 0xB6, 8 }, { 0x22, 7 },
+ { 0x16A, 9 }, { 0x2D0, 10 }, { 0xB48, 12 }, { 0x77, 7 },
+ { 0x1692, 13 }, { 0x0, 3 }, { 0x3, 3 }, { 0x3, 4 },
+ { 0x9, 4 }, { 0xC, 4 }, { 0x5, 4 }, { 0x2, 4 },
+ { 0x1C, 5 }, { 0x8, 4 }, { 0xD, 4 }, { 0xF, 4 },
+ { 0xA, 4 }, { 0x9, 5 }, { 0x23, 7 }, { 0x3A, 6 },
+ { 0x2C, 6 }, { 0x16B, 9 }, { 0x5A5, 11 }, { 0x2D3, 10 },
+ { 0x2D1, 10 }, { 0x1693, 13 }, { 0x76, 7 }, { 0xB7, 8 }
+ },
+ { /* DC bias table 3 */
+ { 0x1E, 5 }, { 0x13, 6 }, { 0xFB, 8 }, { 0x7C, 7 },
+ { 0x46, 8 }, { 0x7D6, 11 }, { 0xFA9, 12 }, { 0x12, 6 },
+ { 0x1F50, 13 }, { 0x1, 3 }, { 0x4, 3 }, { 0x5, 4 },
+ { 0xA, 4 }, { 0xE, 4 }, { 0x7, 4 }, { 0x0, 4 },
+ { 0x17, 5 }, { 0x6, 4 }, { 0xD, 4 }, { 0xC, 4 },
+ { 0x1, 4 }, { 0x2C, 6 }, { 0x8F, 9 }, { 0x3F, 6 },
+ { 0x2D, 6 }, { 0x1F4, 9 }, { 0x7D5, 11 }, { 0x8E, 9 },
+ { 0x7D7, 11 }, { 0x1F51, 13 }, { 0x10, 6 }, { 0x22, 7 }
+ },
+ { /* DC bias table 4 */
+ { 0x1, 4 }, { 0x2B, 6 }, { 0x12, 7 }, { 0x55, 7 },
+ { 0x27, 8 }, { 0x3B0, 10 }, { 0x762, 11 }, { 0x77, 7 },
+ { 0x261, 12 }, { 0x2, 3 }, { 0x6, 3 }, { 0x7, 4 },
+ { 0xB, 4 }, { 0xF, 4 }, { 0x8, 4 }, { 0x0, 4 },
+ { 0x1C, 5 }, { 0x3, 4 }, { 0x9, 4 }, { 0x6, 4 },
+ { 0x14, 5 }, { 0x54, 7 }, { 0x131, 11 }, { 0x5, 5 },
+ { 0x3A, 6 }, { 0x1D9, 9 }, { 0x99, 10 }, { 0x4D, 9 },
+ { 0x763, 11 }, { 0x260, 12 }, { 0x8, 6 }, { 0xED, 8 }
+ },
+ { /* DC bias table 5 */
+ { 0x4, 4 }, { 0x33, 6 }, { 0x60, 7 }, { 0x65, 7 },
+ { 0xC2, 8 }, { 0x30D, 10 }, { 0x619, 11 }, { 0x64, 7 },
+ { 0x1862, 13 }, { 0x4, 3 }, { 0x7, 3 }, { 0xA, 4 },
+ { 0xB, 4 }, { 0xD, 4 }, { 0x6, 4 }, { 0x0, 4 },
+ { 0xF, 5 }, { 0x3, 4 }, { 0x5, 4 }, { 0x2, 4 },
+ { 0x2, 5 }, { 0x77, 8 }, { 0xC30, 12 }, { 0x3, 5 },
+ { 0x31, 6 }, { 0x187, 9 }, { 0x1D9, 10 }, { 0xED, 9 },
+ { 0x1D8, 10 }, { 0x1863, 13 }, { 0x1C, 6 }, { 0x3A, 7 }
+ },
+ { /* DC bias table 6 */
+ { 0x8, 4 }, { 0xA, 5 }, { 0x6A, 7 }, { 0x16, 6 },
+ { 0x1E, 7 }, { 0x34E, 10 }, { 0x69F, 11 }, { 0x68, 7 },
+ { 0xD28, 12 }, { 0x5, 3 }, { 0x7, 3 }, { 0x7, 4 },
+ { 0xC, 4 }, { 0x0, 3 }, { 0x6, 4 }, { 0x1B, 5 },
+ { 0x12, 5 }, { 0x2, 4 }, { 0x4, 4 }, { 0x13, 5 },
+ { 0xE, 6 }, { 0x34B, 10 }, { 0x1A53, 13 }, { 0x6, 5 },
+ { 0x17, 6 }, { 0x1A6, 9 }, { 0x69E, 11 }, { 0x1A4, 9 },
+ { 0x695, 11 }, { 0x1A52, 13 }, { 0x6B, 7 }, { 0x1F, 7 }
+ },
+ { /* DC bias table 7 */
+ { 0xE, 4 }, { 0xF, 5 }, { 0x17, 6 }, { 0x25, 6 },
+ { 0x9F, 8 }, { 0x138, 9 }, { 0x24B, 10 }, { 0x93, 8 },
+ { 0x92A, 12 }, { 0x5, 3 }, { 0x0, 2 }, { 0x8, 4 },
+ { 0xD, 4 }, { 0xF, 4 }, { 0x6, 4 }, { 0x4, 4 },
+ { 0xE, 5 }, { 0x19, 5 }, { 0x18, 5 }, { 0xA, 5 },
+ { 0x9E, 8 }, { 0x494, 11 }, { 0x1256, 13 }, { 0x26, 6 },
+ { 0x16, 6 }, { 0x124, 9 }, { 0x4E5, 11 }, { 0x273, 10 },
+ { 0x4E4, 11 }, { 0x1257, 13 }, { 0x48, 7 }, { 0x9D, 8 }
+ },
+ { /* DC bias table 8 */
+ { 0x4, 4 }, { 0x2C, 6 }, { 0x50, 7 }, { 0x1E, 7 },
+ { 0x71, 9 }, { 0xE1, 10 }, { 0xE0, 10 }, { 0x1D, 7 },
+ { 0x6, 6 }, { 0x7, 3 }, { 0x6, 3 }, { 0x7, 4 },
+ { 0x5, 4 }, { 0x6, 4 }, { 0x15, 5 }, { 0x0, 5 },
+ { 0x29, 6 }, { 0x2, 5 }, { 0x6, 5 }, { 0x1, 5 },
+ { 0x23, 6 }, { 0x1F, 7 }, { 0x39, 8 }, { 0x9, 4 },
+ { 0x2, 4 }, { 0x10, 5 }, { 0x7, 6 }, { 0x2D, 6 },
+ { 0x2F, 6 }, { 0x2E, 6 }, { 0x22, 6 }, { 0x51, 7 }
+ },
+ { /* DC bias table 9 */
+ { 0x8, 4 }, { 0x2F, 6 }, { 0x51, 7 }, { 0x50, 7 },
+ { 0x2ED, 10 }, { 0x5D9, 11 }, { 0x5D8, 11 }, { 0xBA, 8 },
+ { 0x5C, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x9, 4 },
+ { 0x6, 4 }, { 0x7, 4 }, { 0x16, 5 }, { 0x5, 5 },
+ { 0x2B, 6 }, { 0x6, 5 }, { 0xA, 5 }, { 0x1, 5 },
+ { 0xF, 6 }, { 0x1D, 7 }, { 0x177, 9 }, { 0x4, 4 },
+ { 0x1, 4 }, { 0x4, 5 }, { 0x1, 6 }, { 0x2A, 6 },
+ { 0xB, 5 }, { 0x29, 6 }, { 0x0, 6 }, { 0x1C, 7 }
+ },
+ { /* DC bias table 10 */
+ { 0xA, 4 }, { 0x3C, 6 }, { 0x74, 7 }, { 0x4E, 7 },
+ { 0x26D, 10 }, { 0x4D9, 11 }, { 0x4D8, 11 }, { 0x9A, 8 },
+ { 0x4C, 7 }, { 0x0, 2 }, { 0x6, 3 }, { 0x8, 4 },
+ { 0x7, 4 }, { 0x6, 4 }, { 0x16, 5 }, { 0x8, 5 },
+ { 0x2E, 6 }, { 0xA, 5 }, { 0xB, 5 }, { 0x3D, 6 },
+ { 0x24, 6 }, { 0xEB, 8 }, { 0x137, 9 }, { 0x1F, 5 },
+ { 0x1C, 5 }, { 0x3B, 6 }, { 0x12, 6 }, { 0x25, 6 },
+ { 0x2F, 6 }, { 0x13, 6 }, { 0x4F, 7 }, { 0xEA, 8 }
+ },
+ { /* DC bias table 11 */
+ { 0xA, 4 }, { 0xA, 5 }, { 0x3, 6 }, { 0x16, 6 },
+ { 0x9, 8 }, { 0x21, 10 }, { 0x20, 10 }, { 0xB3, 8 },
+ { 0x58, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x7, 4 },
+ { 0x6, 4 }, { 0x4, 4 }, { 0x13, 5 }, { 0x2, 5 },
+ { 0x25, 6 }, { 0x0, 5 }, { 0x3, 5 }, { 0x2D, 6 },
+ { 0x5D, 7 }, { 0xB2, 8 }, { 0x11, 9 }, { 0x8, 4 },
+ { 0x2, 4 }, { 0x6, 5 }, { 0x17, 6 }, { 0x2F, 6 },
+ { 0x7, 5 }, { 0x24, 6 }, { 0x5C, 7 }, { 0x5, 7 }
+ },
+ { /* DC bias table 12 */
+ { 0xB, 4 }, { 0x13, 5 }, { 0x1F, 6 }, { 0x31, 6 },
+ { 0x21, 7 }, { 0x295, 10 }, { 0x528, 11 }, { 0xA4, 8 },
+ { 0x3C, 7 }, { 0x0, 2 }, { 0x7, 3 }, { 0x6, 4 },
+ { 0x5, 4 }, { 0x1B, 5 }, { 0x12, 5 }, { 0x32, 6 },
+ { 0x1D, 6 }, { 0x2B, 6 }, { 0x30, 6 }, { 0x1C, 6 },
+ { 0x3D, 7 }, { 0x14B, 9 }, { 0x529, 11 }, { 0x8, 4 },
+ { 0x1A, 5 }, { 0x33, 6 }, { 0x11, 6 }, { 0x2A, 6 },
+ { 0x9, 5 }, { 0x28, 6 }, { 0x53, 7 }, { 0x20, 7 }
+ },
+ { /* DC bias table 13 */
+ { 0xE, 4 }, { 0x15, 5 }, { 0x29, 6 }, { 0x3F, 6 },
+ { 0x4D, 7 }, { 0x2F1, 10 }, { 0x5E0, 11 }, { 0x92, 8 },
+ { 0x48, 7 }, { 0x0, 2 }, { 0x6, 3 }, { 0x6, 4 },
+ { 0x5, 4 }, { 0x4, 4 }, { 0xF, 5 }, { 0x2E, 6 },
+ { 0x1D, 6 }, { 0x28, 6 }, { 0x27, 6 }, { 0x5F, 7 },
+ { 0xBD, 8 }, { 0x179, 9 }, { 0x5E1, 11 }, { 0x8, 4 },
+ { 0x1E, 5 }, { 0x2D, 6 }, { 0x1C, 6 }, { 0x2C, 6 },
+ { 0x3E, 6 }, { 0x25, 6 }, { 0x4C, 7 }, { 0x93, 8 }
+ },
+ { /* DC bias table 14 */
+ { 0xC, 4 }, { 0x17, 5 }, { 0x35, 6 }, { 0x13, 5 },
+ { 0x21, 6 }, { 0xAD, 8 }, { 0x6F1, 11 }, { 0x1BD, 9 },
+ { 0xD9, 8 }, { 0x0, 2 }, { 0x7, 3 }, { 0x7, 4 },
+ { 0x6, 4 }, { 0x4, 4 }, { 0x11, 5 }, { 0x2A, 6 },
+ { 0x6E, 7 }, { 0x25, 6 }, { 0x24, 6 }, { 0x57, 7 },
+ { 0xD8, 8 }, { 0x379, 10 }, { 0x6F0, 11 }, { 0x5, 4 },
+ { 0x16, 5 }, { 0x29, 6 }, { 0x6D, 7 }, { 0x28, 6 },
+ { 0x34, 6 }, { 0x20, 6 }, { 0xDF, 8 }, { 0xAC, 8 }
+ },
+ { /* DC bias table 15 */
+ { 0x0, 3 }, { 0x1A, 5 }, { 0x6, 5 }, { 0x19, 5 },
+ { 0x30, 6 }, { 0x5A, 7 }, { 0x18A, 9 }, { 0x2DD, 10 },
+ { 0x18B, 9 }, { 0x1, 2 }, { 0x7, 3 }, { 0xA, 4 },
+ { 0x9, 4 }, { 0x2, 4 }, { 0x10, 5 }, { 0x2E, 6 },
+ { 0x6E, 7 }, { 0x2C, 6 }, { 0xE, 6 }, { 0x5E, 7 },
+ { 0xC4, 8 }, { 0x5B9, 11 }, { 0x5B8, 11 }, { 0x11, 5 },
+ { 0x36, 6 }, { 0x5F, 7 }, { 0x1E, 7 }, { 0x63, 7 },
+ { 0x6F, 7 }, { 0x1F, 7 }, { 0xB6, 8 }, { 0x16F, 9 }
+ }
+};
+
+static const uint16_t vp4_ac_bias_0[16][32][2] = {
+ { /* AC bias group 1, table 0 */
+ { 0x6, 5 }, { 0x1E, 7 }, { 0x1CC, 9 }, { 0x1CE, 9 },
+ { 0x734, 11 }, { 0x1CD5, 13 }, { 0x1CD4, 13 }, { 0x18, 5 },
+ { 0xE6B, 12 }, { 0x0, 3 }, { 0xF, 4 }, { 0x6, 4 },
+ { 0x7, 4 }, { 0xD, 4 }, { 0x8, 4 }, { 0x2, 4 },
+ { 0x19, 5 }, { 0x5, 4 }, { 0xB, 4 }, { 0xA, 4 },
+ { 0x1D, 5 }, { 0x27, 6 }, { 0x1CF, 9 }, { 0x4, 4 },
+ { 0x38, 6 }, { 0xE, 6 }, { 0x4C, 7 }, { 0x1F, 7 },
+ { 0x4D, 7 }, { 0x39B, 10 }, { 0x12, 5 }, { 0x72, 7 }
+ },
+ { /* AC bias group 1, table 1 */
+ { 0x9, 5 }, { 0x4B, 7 }, { 0x90, 8 }, { 0x91, 8 },
+ { 0x745, 11 }, { 0x1D11, 13 }, { 0x1D10, 13 }, { 0x19, 5 },
+ { 0xE89, 12 }, { 0x0, 3 }, { 0xF, 4 }, { 0x8, 4 },
+ { 0x7, 4 }, { 0xD, 4 }, { 0xB, 4 }, { 0x2, 4 },
+ { 0x1C, 5 }, { 0x3, 4 }, { 0xA, 4 }, { 0x5, 4 },
+ { 0x18, 5 }, { 0x10, 6 }, { 0x1D0, 9 }, { 0x6, 4 },
+ { 0x3B, 6 }, { 0x11, 6 }, { 0x4A, 7 }, { 0x49, 7 },
+ { 0xE9, 8 }, { 0x3A3, 10 }, { 0x13, 5 }, { 0x75, 7 }
+ },
+ { /* AC bias group 1, table 2 */
+ { 0x19, 5 }, { 0x74, 7 }, { 0x1D, 8 }, { 0xEA, 8 },
+ { 0x73, 10 }, { 0x1CA, 12 }, { 0x396, 13 }, { 0x1C, 5 },
+ { 0xE4, 11 }, { 0x2, 3 }, { 0x1, 3 }, { 0x7, 4 },
+ { 0x8, 4 }, { 0xD, 4 }, { 0x9, 4 }, { 0x1F, 5 },
+ { 0x18, 5 }, { 0x0, 4 }, { 0x6, 4 }, { 0x1E, 5 },
+ { 0x3B, 6 }, { 0xEB, 8 }, { 0x397, 13 }, { 0xA, 4 },
+ { 0x2, 5 }, { 0x2C, 6 }, { 0x5B, 7 }, { 0x5A, 7 },
+ { 0xF, 7 }, { 0x38, 9 }, { 0x17, 5 }, { 0x6, 6 }
+ },
+ { /* AC bias group 1, table 3 */
+ { 0x1E, 5 }, { 0x6F, 7 }, { 0xAE, 8 }, { 0xAF, 8 },
+ { 0x187, 10 }, { 0x61B, 12 }, { 0xC35, 13 }, { 0x1A, 5 },
+ { 0x30C, 11 }, { 0x2, 3 }, { 0x1, 3 }, { 0x7, 4 },
+ { 0x8, 4 }, { 0xE, 4 }, { 0x9, 4 }, { 0x1F, 5 },
+ { 0x14, 5 }, { 0x0, 4 }, { 0x1, 4 }, { 0x19, 5 },
+ { 0x2A, 6 }, { 0x60, 8 }, { 0xC34, 13 }, { 0xB, 4 },
+ { 0xD, 5 }, { 0x36, 6 }, { 0x6E, 7 }, { 0x56, 7 },
+ { 0x31, 7 }, { 0xC2, 9 }, { 0x18, 5 }, { 0x19, 6 }
+ },
+ { /* AC bias group 1, table 4 */
+ { 0x1, 4 }, { 0x2C, 6 }, { 0x5, 7 }, { 0x15, 7 },
+ { 0x8, 8 }, { 0x97, 12 }, { 0x12D, 13 }, { 0x17, 5 },
+ { 0x4A, 11 }, { 0x3, 3 }, { 0x2, 3 }, { 0x9, 4 },
+ { 0xA, 4 }, { 0xE, 4 }, { 0x8, 4 }, { 0x1F, 5 },
+ { 0x7, 5 }, { 0x1E, 5 }, { 0x1B, 5 }, { 0x4, 5 },
+ { 0x5A, 7 }, { 0x24, 10 }, { 0x12C, 13 }, { 0xC, 4 },
+ { 0x6, 5 }, { 0x0, 5 }, { 0x3, 6 }, { 0x5B, 7 },
+ { 0x14, 7 }, { 0x13, 9 }, { 0x1A, 5 }, { 0xB, 6 }
+ },
+ { /* AC bias group 1, table 5 */
+ { 0x4, 4 }, { 0x0, 5 }, { 0x17, 7 }, { 0x63, 7 },
+ { 0x18B, 9 }, { 0x310, 10 }, { 0xC44, 12 }, { 0x19, 5 },
+ { 0x623, 11 }, { 0x4, 3 }, { 0x3, 3 }, { 0xA, 4 },
+ { 0xB, 4 }, { 0xD, 4 }, { 0x3, 4 }, { 0x1C, 5 },
+ { 0x3, 5 }, { 0xA, 5 }, { 0x4, 5 }, { 0x3, 6 },
+ { 0x18A, 9 }, { 0x188B, 13 }, { 0x188A, 13 }, { 0xF, 4 },
+ { 0xB, 5 }, { 0x2, 5 }, { 0xA, 6 }, { 0x2, 6 },
+ { 0x16, 7 }, { 0x189, 9 }, { 0x1D, 5 }, { 0x30, 6 }
+ },
+ { /* AC bias group 1, table 6 */
+ { 0xD, 4 }, { 0x3, 5 }, { 0x77, 7 }, { 0xD, 6 },
+ { 0x82, 8 }, { 0x20D, 10 }, { 0x830, 12 }, { 0x19, 5 },
+ { 0x419, 11 }, { 0x3, 3 }, { 0x2, 3 }, { 0xA, 4 },
+ { 0x9, 4 }, { 0xB, 4 }, { 0x2, 4 }, { 0x11, 5 },
+ { 0x39, 6 }, { 0x2, 5 }, { 0x21, 6 }, { 0x40, 7 },
+ { 0x1063, 13 }, { 0x20C5, 14 }, { 0x20C4, 14 }, { 0xF, 4 },
+ { 0x18, 5 }, { 0x7, 5 }, { 0x38, 6 }, { 0xC, 6 },
+ { 0x76, 7 }, { 0x107, 9 }, { 0x0, 4 }, { 0x3A, 6 }
+ },
+ { /* AC bias group 1, table 7 */
+ { 0xF, 4 }, { 0x1C, 5 }, { 0x36, 6 }, { 0x8, 5 },
+ { 0x61, 7 }, { 0x91, 8 }, { 0x243, 10 }, { 0x9, 5 },
+ { 0x120, 9 }, { 0x5, 3 }, { 0x3, 3 }, { 0x8, 4 },
+ { 0x5, 4 }, { 0x1, 4 }, { 0x13, 5 }, { 0x31, 6 },
+ { 0x76, 7 }, { 0x60, 7 }, { 0x93, 8 }, { 0x909, 12 },
+ { 0x908, 12 }, { 0x90B, 12 }, { 0x90A, 12 }, { 0x1, 3 },
+ { 0x1A, 5 }, { 0x19, 5 }, { 0x3A, 6 }, { 0x25, 6 },
+ { 0x77, 7 }, { 0x92, 8 }, { 0x0, 4 }, { 0x37, 6 }
+ },
+ { /* AC bias group 1, table 8 */
+ { 0x1F, 5 }, { 0x79, 7 }, { 0xF1, 8 }, { 0xF0, 8 },
+ { 0x11B, 10 }, { 0x469, 12 }, { 0x468, 12 }, { 0x3B, 6 },
+ { 0x22, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x7, 4 },
+ { 0x5, 4 }, { 0x6, 4 }, { 0x1C, 5 }, { 0x1, 5 },
+ { 0x35, 6 }, { 0x3D, 6 }, { 0x3A, 6 }, { 0x10, 6 },
+ { 0x47, 8 }, { 0x8C, 9 }, { 0x235, 11 }, { 0x1, 3 },
+ { 0x1, 4 }, { 0x19, 5 }, { 0x0, 5 }, { 0x30, 6 },
+ { 0x9, 5 }, { 0x31, 6 }, { 0x1B, 5 }, { 0x34, 6 }
+ },
+ { /* AC bias group 1, table 9 */
+ { 0x3, 4 }, { 0x1B, 6 }, { 0xF3, 8 }, { 0xFD, 8 },
+ { 0x3C9, 10 }, { 0xF20, 12 }, { 0x1E42, 13 }, { 0x3D, 6 },
+ { 0xFC, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 },
+ { 0x0, 4 }, { 0x1, 4 }, { 0x17, 5 }, { 0x3E, 6 },
+ { 0x1A, 6 }, { 0x39, 6 }, { 0x2B, 6 }, { 0x78, 7 },
+ { 0x1E5, 9 }, { 0x791, 11 }, { 0x1E43, 13 }, { 0x2, 3 },
+ { 0x7, 4 }, { 0x1D, 5 }, { 0xC, 5 }, { 0x38, 6 },
+ { 0x14, 5 }, { 0x7F, 7 }, { 0x16, 5 }, { 0x2A, 6 }
+ },
+ { /* AC bias group 1, table 10 */
+ { 0x7, 4 }, { 0x39, 6 }, { 0x51, 7 }, { 0x78, 7 },
+ { 0x3CB, 10 }, { 0xF29, 12 }, { 0x1E51, 13 }, { 0x3D, 6 },
+ { 0xF3, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 },
+ { 0x0, 4 }, { 0x1, 4 }, { 0x17, 5 }, { 0x3E, 6 },
+ { 0x7F, 7 }, { 0x2B, 6 }, { 0x7E, 7 }, { 0x50, 7 },
+ { 0x1E4, 9 }, { 0x795, 11 }, { 0x1E50, 13 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x1D, 5 }, { 0x6, 5 }, { 0x38, 6 },
+ { 0x7, 5 }, { 0x29, 6 }, { 0x16, 5 }, { 0x2A, 6 }
+ },
+ { /* AC bias group 1, table 11 */
+ { 0x8, 4 }, { 0x3B, 6 }, { 0x1D, 7 }, { 0x72, 7 },
+ { 0x1CC, 9 }, { 0x734, 11 }, { 0x1CD5, 13 }, { 0x3A, 6 },
+ { 0x1C, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x0, 4 }, { 0x12, 5 }, { 0x3E, 6 },
+ { 0x7F, 7 }, { 0x1E, 6 }, { 0x7E, 7 }, { 0xE7, 8 },
+ { 0x39B, 10 }, { 0xE6B, 12 }, { 0x1CD4, 13 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x1E, 5 }, { 0xE, 5 }, { 0x38, 6 },
+ { 0x6, 5 }, { 0xF, 6 }, { 0x13, 5 }, { 0x1F, 6 }
+ },
+ { /* AC bias group 1, table 12 */
+ { 0xD, 4 }, { 0x3F, 6 }, { 0x73, 7 }, { 0xC, 6 },
+ { 0xE4, 8 }, { 0x72B, 11 }, { 0xE54, 12 }, { 0x3A, 6 },
+ { 0x1A, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x0, 4 }, { 0x7, 5 }, { 0x38, 6 },
+ { 0x76, 7 }, { 0x77, 7 }, { 0x1B, 7 }, { 0x1CB, 9 },
+ { 0x394, 10 }, { 0x1CAB, 13 }, { 0x1CAA, 13 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x1E, 5 }, { 0xE, 5 }, { 0x3E, 6 },
+ { 0x19, 5 }, { 0x1F, 6 }, { 0x18, 5 }, { 0x1E, 6 }
+ },
+ { /* AC bias group 1, table 13 */
+ { 0xE, 4 }, { 0x7, 5 }, { 0xC, 6 }, { 0x1C, 6 },
+ { 0xBD, 8 }, { 0x2F3, 10 }, { 0xBC9, 12 }, { 0x1F, 6 },
+ { 0xBF, 8 }, { 0x6, 3 }, { 0x4, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x1E, 5 }, { 0x1, 5 }, { 0xD, 6 },
+ { 0x3A, 7 }, { 0x3B, 7 }, { 0xBE, 8 }, { 0x178, 9 },
+ { 0x5E5, 11 }, { 0x1791, 13 }, { 0x1790, 13 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x1F, 5 }, { 0x16, 5 }, { 0x0, 5 },
+ { 0x15, 5 }, { 0x2E, 6 }, { 0x14, 5 }, { 0x1E, 6 }
+ },
+ { /* AC bias group 1, table 14 */
+ { 0x0, 3 }, { 0x1B, 5 }, { 0x31, 6 }, { 0x3A, 6 },
+ { 0x60, 7 }, { 0x6F, 9 }, { 0x1B9, 11 }, { 0xE, 6 },
+ { 0x1A, 7 }, { 0x5, 3 }, { 0x3, 3 }, { 0x2, 4 },
+ { 0x1F, 5 }, { 0x1A, 5 }, { 0x39, 6 }, { 0xC, 6 },
+ { 0xC3, 8 }, { 0xC2, 8 }, { 0x36, 8 }, { 0xDD, 10 },
+ { 0x370, 12 }, { 0x6E3, 13 }, { 0x6E2, 13 }, { 0x2, 3 },
+ { 0x8, 4 }, { 0x1E, 5 }, { 0x19, 5 }, { 0x3B, 6 },
+ { 0x12, 5 }, { 0xF, 6 }, { 0x13, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 1, table 15 */
+ { 0x2, 3 }, { 0x0, 4 }, { 0x3, 5 }, { 0x1C, 5 },
+ { 0x32, 6 }, { 0x1C, 7 }, { 0x199, 9 }, { 0x4, 6 },
+ { 0xCD, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0x1B, 5 },
+ { 0x1A, 5 }, { 0x3D, 6 }, { 0x67, 7 }, { 0x3B, 8 },
+ { 0x198, 9 }, { 0x75, 9 }, { 0xE9, 10 }, { 0x3A1, 12 },
+ { 0x3A0, 12 }, { 0x3A3, 12 }, { 0x3A2, 12 }, { 0x5, 3 },
+ { 0x2, 4 }, { 0x1F, 5 }, { 0x1D, 5 }, { 0x3C, 6 },
+ { 0x18, 5 }, { 0xF, 6 }, { 0x6, 5 }, { 0x5, 6 }
+ }
+};
+
+static const uint16_t vp4_ac_bias_1[16][32][2] = {
+ { /* AC bias group 2, table 0 */
+ { 0x4, 5 }, { 0xF5, 8 }, { 0x182, 9 }, { 0x60F, 11 },
+ { 0x1839, 13 }, { 0x1838, 13 }, { 0x183B, 13 }, { 0x13, 5 },
+ { 0xC0, 8 }, { 0x3, 3 }, { 0x2, 3 }, { 0xB, 4 },
+ { 0xA, 4 }, { 0xE, 4 }, { 0x8, 4 }, { 0x1, 4 },
+ { 0x12, 5 }, { 0x1F, 5 }, { 0x0, 4 }, { 0x6, 5 },
+ { 0x7B, 7 }, { 0x306, 10 }, { 0x183A, 13 }, { 0xD, 4 },
+ { 0x7, 5 }, { 0x31, 6 }, { 0xA, 6 }, { 0x61, 7 },
+ { 0x3C, 6 }, { 0xF4, 8 }, { 0x19, 5 }, { 0xB, 6 }
+ },
+ { /* AC bias group 2, table 1 */
+ { 0xA, 5 }, { 0x1A, 7 }, { 0x1D8, 9 }, { 0x3B3, 10 },
+ { 0xECA, 12 }, { 0x1D96, 13 }, { 0x3B2F, 14 }, { 0x14, 5 },
+ { 0x36, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0xC, 4 },
+ { 0xB, 4 }, { 0x0, 3 }, { 0x4, 4 }, { 0x1C, 5 },
+ { 0x5, 5 }, { 0x15, 5 }, { 0x7, 5 }, { 0x17, 6 },
+ { 0x37, 8 }, { 0x764, 11 }, { 0x3B2E, 14 }, { 0xF, 4 },
+ { 0x1A, 5 }, { 0x3A, 6 }, { 0xC, 6 }, { 0x77, 7 },
+ { 0x4, 5 }, { 0xED, 8 }, { 0x1B, 5 }, { 0x16, 6 }
+ },
+ { /* AC bias group 2, table 2 */
+ { 0x1A, 5 }, { 0x2D, 7 }, { 0x58, 8 }, { 0x1F4, 9 },
+ { 0x7D4, 11 }, { 0x1F55, 13 }, { 0x1F54, 13 }, { 0x14, 5 },
+ { 0x59, 8 }, { 0x4, 3 }, { 0x3, 3 }, { 0xB, 4 },
+ { 0xC, 4 }, { 0xE, 4 }, { 0x4, 4 }, { 0x15, 5 },
+ { 0x5, 5 }, { 0x7, 5 }, { 0x4, 5 }, { 0x7C, 7 },
+ { 0x3EB, 10 }, { 0x1F57, 13 }, { 0x1F56, 13 }, { 0x0, 3 },
+ { 0x1B, 5 }, { 0x3F, 6 }, { 0xD, 6 }, { 0xC, 6 },
+ { 0xA, 5 }, { 0xFB, 8 }, { 0x1E, 5 }, { 0x17, 6 }
+ },
+ { /* AC bias group 2, table 3 */
+ { 0x0, 4 }, { 0x75, 7 }, { 0x4A, 8 }, { 0x97, 9 },
+ { 0x25B, 11 }, { 0x969, 13 }, { 0x968, 13 }, { 0xB, 5 },
+ { 0xE8, 8 }, { 0x5, 3 }, { 0x4, 3 }, { 0x7, 4 },
+ { 0xC, 4 }, { 0xD, 4 }, { 0x1, 4 }, { 0xA, 5 },
+ { 0x39, 6 }, { 0x3B, 6 }, { 0x18, 6 }, { 0xE9, 8 },
+ { 0x12C, 10 }, { 0x96B, 13 }, { 0x96A, 13 }, { 0x1, 3 },
+ { 0x1F, 5 }, { 0x8, 5 }, { 0x19, 6 }, { 0x13, 6 },
+ { 0xD, 5 }, { 0x24, 7 }, { 0x1E, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 2, table 4 */
+ { 0x4, 4 }, { 0x14, 6 }, { 0x6E, 8 }, { 0x57, 8 },
+ { 0x159, 10 }, { 0x562, 12 }, { 0xAC7, 13 }, { 0xB, 5 },
+ { 0x6F, 8 }, { 0x6, 3 }, { 0x5, 3 }, { 0x8, 4 },
+ { 0x9, 4 }, { 0x7, 4 }, { 0x1E, 5 }, { 0x2, 5 },
+ { 0x7, 6 }, { 0x6, 6 }, { 0x2A, 7 }, { 0xAD, 9 },
+ { 0xAC6, 13 }, { 0x561, 12 }, { 0x560, 12 }, { 0x1, 3 },
+ { 0x1F, 5 }, { 0xC, 5 }, { 0x39, 6 }, { 0x1A, 6 },
+ { 0x0, 4 }, { 0x36, 7 }, { 0x1D, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 2, table 5 */
+ { 0x7, 4 }, { 0x1B, 6 }, { 0xE, 7 }, { 0xD, 7 },
+ { 0x3E1, 10 }, { 0x1F06, 13 }, { 0x3E0F, 14 }, { 0x2, 5 },
+ { 0xF9, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x8, 4 },
+ { 0x9, 4 }, { 0x4, 4 }, { 0xC, 5 }, { 0x1A, 6 },
+ { 0xF, 7 }, { 0xC, 7 }, { 0x1F1, 9 }, { 0x7C0, 11 },
+ { 0x3E0E, 14 }, { 0x1F05, 13 }, { 0x1F04, 13 }, { 0x1, 3 },
+ { 0x0, 4 }, { 0x1C, 5 }, { 0x3F, 6 }, { 0x3D, 6 },
+ { 0x5, 4 }, { 0x7D, 7 }, { 0x1D, 5 }, { 0x3C, 6 }
+ },
+ { /* AC bias group 2, table 6 */
+ { 0xF, 4 }, { 0xA, 5 }, { 0x71, 7 }, { 0x6, 6 },
+ { 0x1C2, 9 }, { 0x702, 11 }, { 0x1C0E, 13 }, { 0x2, 5 },
+ { 0xE, 7 }, { 0x5, 3 }, { 0x4, 3 }, { 0x6, 4 },
+ { 0x7, 4 }, { 0x1D, 5 }, { 0x17, 6 }, { 0xF, 7 },
+ { 0x1C3, 9 }, { 0x1C1, 9 }, { 0x380, 10 }, { 0x381F, 14 },
+ { 0x381E, 14 }, { 0x1C0D, 13 }, { 0x1C0C, 13 }, { 0x1, 3 },
+ { 0x4, 4 }, { 0x18, 5 }, { 0x1, 5 }, { 0x0, 5 },
+ { 0xD, 4 }, { 0x16, 6 }, { 0x19, 5 }, { 0x39, 6 }
+ },
+ { /* AC bias group 2, table 7 */
+ { 0x2, 3 }, { 0x1E, 5 }, { 0x3B, 6 }, { 0xD, 5 },
+ { 0x61, 7 }, { 0x1FA, 9 }, { 0x1FB5, 13 }, { 0x31, 6 },
+ { 0xFC, 8 }, { 0x4, 3 }, { 0x5, 3 }, { 0x1, 4 },
+ { 0x7, 4 }, { 0x3A, 6 }, { 0x60, 7 }, { 0x3F7, 10 },
+ { 0x7EC, 11 }, { 0x1FB7, 13 }, { 0x3F6C, 14 }, { 0x7EDB, 15 },
+ { 0x7EDA, 15 }, { 0x3F69, 14 }, { 0x3F68, 14 }, { 0x1, 3 },
+ { 0x0, 4 }, { 0x19, 5 }, { 0x3E, 6 }, { 0x39, 6 },
+ { 0xD, 4 }, { 0x38, 6 }, { 0xC, 5 }, { 0x7F, 7 }
+ },
+ { /* AC bias group 2, table 8 */
+ { 0x1E, 5 }, { 0x70, 7 }, { 0x127, 9 }, { 0x126, 9 },
+ { 0x492, 11 }, { 0x124D, 13 }, { 0x124C, 13 }, { 0x1, 5 },
+ { 0x7F, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x5, 4 },
+ { 0x4, 4 }, { 0x1, 4 }, { 0x7, 5 }, { 0x25, 6 },
+ { 0x71, 7 }, { 0x7E, 7 }, { 0x48, 7 }, { 0x125, 9 },
+ { 0x248, 10 }, { 0x124F, 13 }, { 0x124E, 13 }, { 0x3, 3 },
+ { 0x8, 4 }, { 0x1D, 5 }, { 0x6, 5 }, { 0x3E, 6 },
+ { 0x2, 4 }, { 0x0, 5 }, { 0x13, 5 }, { 0x39, 6 }
+ },
+ { /* AC bias group 2, table 9 */
+ { 0x1, 4 }, { 0x1, 6 }, { 0xE7, 8 }, { 0x91, 8 },
+ { 0x240, 10 }, { 0x120D, 13 }, { 0x120C, 13 }, { 0x3C, 6 },
+ { 0x0, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x5, 4 },
+ { 0x4, 4 }, { 0x1F, 5 }, { 0x4, 5 }, { 0x25, 6 },
+ { 0x72, 7 }, { 0x49, 7 }, { 0xE6, 8 }, { 0x121, 9 },
+ { 0x482, 11 }, { 0x120F, 13 }, { 0x120E, 13 }, { 0x3, 3 },
+ { 0x8, 4 }, { 0x1D, 5 }, { 0x5, 5 }, { 0x3D, 6 },
+ { 0x3, 4 }, { 0x1, 5 }, { 0x13, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 2, table 10 */
+ { 0x4, 4 }, { 0xF, 6 }, { 0xF4, 8 }, { 0x5B, 8 },
+ { 0x2D3, 11 }, { 0xB4A, 13 }, { 0x1697, 14 }, { 0x3C, 6 },
+ { 0xE, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x1D, 5 }, { 0x0, 5 }, { 0x7B, 7 },
+ { 0x2C, 7 }, { 0xF5, 8 }, { 0xB5, 9 }, { 0x168, 10 },
+ { 0x1696, 14 }, { 0xB49, 13 }, { 0xB48, 13 }, { 0x3, 3 },
+ { 0x9, 4 }, { 0x1F, 5 }, { 0xA, 5 }, { 0x1, 5 },
+ { 0x8, 4 }, { 0x6, 5 }, { 0x1C, 5 }, { 0x17, 6 }
+ },
+ { /* AC bias group 2, table 11 */
+ { 0x8, 4 }, { 0x39, 6 }, { 0x1A, 7 }, { 0x3, 7 },
+ { 0xDB, 10 }, { 0x6D6, 13 }, { 0xDAF, 14 }, { 0x3C, 6 },
+ { 0xC, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x1D, 5 }, { 0x3D, 6 }, { 0x0, 6 },
+ { 0x2, 7 }, { 0x37, 8 }, { 0x6C, 9 }, { 0x1B4, 11 },
+ { 0xDAE, 14 }, { 0x6D5, 13 }, { 0x6D4, 13 }, { 0x2, 3 },
+ { 0x7, 4 }, { 0x1F, 5 }, { 0x7, 5 }, { 0x1, 5 },
+ { 0x9, 4 }, { 0xD, 5 }, { 0xC, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 2, table 12 */
+ { 0xF, 4 }, { 0x4, 5 }, { 0x2F, 7 }, { 0x2E, 7 },
+ { 0x54, 9 }, { 0x555, 13 }, { 0x554, 13 }, { 0x16, 6 },
+ { 0xE, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x1, 4 },
+ { 0x0, 4 }, { 0x9, 5 }, { 0xB, 6 }, { 0x14, 7 },
+ { 0x57, 9 }, { 0x56, 9 }, { 0xAB, 10 }, { 0x557, 13 },
+ { 0x556, 13 }, { 0x2A9, 12 }, { 0x2A8, 12 }, { 0x3, 3 },
+ { 0x8, 4 }, { 0x13, 5 }, { 0xA, 5 }, { 0x8, 5 },
+ { 0xE, 4 }, { 0x12, 5 }, { 0x6, 5 }, { 0xF, 6 }
+ },
+ { /* AC bias group 2, table 13 */
+ { 0x1, 3 }, { 0xE, 5 }, { 0x6, 6 }, { 0x4, 6 },
+ { 0xDA, 9 }, { 0xDBE, 13 }, { 0x1B7E, 14 }, { 0x7, 6 },
+ { 0x1A, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x1C, 5 },
+ { 0x1B, 5 }, { 0x3A, 6 }, { 0x37, 7 }, { 0x6C, 8 },
+ { 0x1B6, 10 }, { 0x36E, 11 }, { 0xDBD, 13 }, { 0x36FF, 15 },
+ { 0x36FE, 15 }, { 0x1B79, 14 }, { 0x1B78, 14 }, { 0x2, 3 },
+ { 0xC, 4 }, { 0x0, 4 }, { 0xF, 5 }, { 0xC, 5 },
+ { 0xF, 4 }, { 0x1A, 5 }, { 0x3B, 6 }, { 0x5, 6 }
+ },
+ { /* AC bias group 2, table 14 */
+ { 0x5, 3 }, { 0x1E, 5 }, { 0x3A, 6 }, { 0x3E, 6 },
+ { 0xFC, 8 }, { 0xFD7, 12 }, { 0x3F55, 14 }, { 0x77, 7 },
+ { 0x30, 6 }, { 0x3, 3 }, { 0x4, 3 }, { 0x1A, 5 },
+ { 0x19, 5 }, { 0x7F, 7 }, { 0x1FB, 9 }, { 0x3F4, 10 },
+ { 0xFD6, 12 }, { 0x1FA9, 13 }, { 0x3F54, 14 }, { 0x3F57, 14 },
+ { 0x3F56, 14 }, { 0x3F51, 14 }, { 0x3F50, 14 }, { 0x1, 3 },
+ { 0x4, 4 }, { 0x1C, 5 }, { 0xB, 5 }, { 0xA, 5 },
+ { 0x0, 3 }, { 0x1B, 5 }, { 0x31, 6 }, { 0x76, 7 }
+ },
+ { /* AC bias group 2, table 15 */
+ { 0x5, 3 }, { 0xC, 4 }, { 0x1B, 5 }, { 0x8, 4 },
+ { 0x38, 6 }, { 0x15, 8 }, { 0xA3, 11 }, { 0xE6, 8 },
+ { 0x4, 6 }, { 0x1, 3 }, { 0x2, 3 }, { 0x12, 5 },
+ { 0x3, 5 }, { 0xB, 7 }, { 0x29, 9 }, { 0xA0, 11 },
+ { 0x142, 12 }, { 0x287, 13 }, { 0x286, 13 }, { 0x289, 13 },
+ { 0x288, 13 }, { 0x28B, 13 }, { 0x28A, 13 }, { 0xF, 4 },
+ { 0x1D, 5 }, { 0x13, 5 }, { 0x1, 5 }, { 0x0, 5 },
+ { 0x3, 3 }, { 0x1A, 5 }, { 0x72, 7 }, { 0xE7, 8 }
+ }
+};
+
+static const uint16_t vp4_ac_bias_2[16][32][2] = {
+ { /* AC bias group 3, table 0 */
+ { 0x9, 5 }, { 0x15, 7 }, { 0x28, 8 }, { 0x52, 9 },
+ { 0x29A, 12 }, { 0x537, 13 }, { 0x536, 13 }, { 0xA, 5 },
+ { 0x54, 7 }, { 0x4, 3 }, { 0x3, 3 }, { 0xC, 4 },
+ { 0xB, 4 }, { 0xD, 4 }, { 0x3, 4 }, { 0x14, 5 },
+ { 0x3A, 6 }, { 0x4, 5 }, { 0x38, 6 }, { 0x55, 7 },
+ { 0xA7, 10 }, { 0x299, 12 }, { 0x298, 12 }, { 0x0, 3 },
+ { 0x1E, 5 }, { 0x8, 5 }, { 0x2B, 6 }, { 0xB, 6 },
+ { 0xB, 5 }, { 0x3B, 6 }, { 0x1F, 5 }, { 0x39, 6 }
+ },
+ { /* AC bias group 3, table 1 */
+ { 0x1D, 5 }, { 0x2F, 7 }, { 0x2, 8 }, { 0x7, 9 },
+ { 0x19, 11 }, { 0x35, 12 }, { 0x34, 12 }, { 0x9, 5 },
+ { 0x2E, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x9, 4 },
+ { 0x8, 4 }, { 0x7, 4 }, { 0x1F, 5 }, { 0x8, 5 },
+ { 0x18, 6 }, { 0x19, 6 }, { 0x1, 6 }, { 0x0, 7 },
+ { 0x18, 11 }, { 0x37, 12 }, { 0x36, 12 }, { 0x1, 3 },
+ { 0x1, 4 }, { 0xA, 5 }, { 0x39, 6 }, { 0x16, 6 },
+ { 0xD, 5 }, { 0x1, 5 }, { 0x1E, 5 }, { 0x38, 6 }
+ },
+ { /* AC bias group 3, table 2 */
+ { 0x1, 4 }, { 0x71, 7 }, { 0xE0, 8 }, { 0x1C3, 9 },
+ { 0x708, 11 }, { 0x1C26, 13 }, { 0x384F, 14 }, { 0x1, 5 },
+ { 0x31, 7 }, { 0x6, 3 }, { 0x5, 3 }, { 0x9, 4 },
+ { 0x8, 4 }, { 0x5, 4 }, { 0xF, 5 }, { 0x39, 6 },
+ { 0x77, 7 }, { 0x76, 7 }, { 0x30, 7 }, { 0x385, 10 },
+ { 0x384E, 14 }, { 0x1C25, 13 }, { 0x1C24, 13 }, { 0x1, 3 },
+ { 0x4, 4 }, { 0xD, 5 }, { 0x0, 5 }, { 0x19, 6 },
+ { 0x1F, 5 }, { 0xE, 5 }, { 0x1E, 5 }, { 0x3A, 6 }
+ },
+ { /* AC bias group 3, table 3 */
+ { 0x6, 4 }, { 0xC, 6 }, { 0xD6, 8 }, { 0x7B, 8 },
+ { 0x1E8, 10 }, { 0x7A4, 12 }, { 0xF4B, 13 }, { 0x36, 6 },
+ { 0x6A, 7 }, { 0x7, 3 }, { 0x5, 3 }, { 0x8, 4 },
+ { 0x9, 4 }, { 0x1, 4 }, { 0x7, 5 }, { 0xD, 6 },
+ { 0x3C, 7 }, { 0xD7, 8 }, { 0xF5, 9 }, { 0x7A7, 12 },
+ { 0xF4A, 13 }, { 0xF4D, 13 }, { 0xF4C, 13 }, { 0x2, 3 },
+ { 0x2, 4 }, { 0xE, 5 }, { 0x37, 6 }, { 0x34, 6 },
+ { 0x0, 4 }, { 0x19, 5 }, { 0x18, 5 }, { 0x1F, 6 }
+ },
+ { /* AC bias group 3, table 4 */
+ { 0xA, 4 }, { 0x27, 6 }, { 0xBF, 8 }, { 0xBE, 8 },
+ { 0x224, 10 }, { 0x225D, 14 }, { 0x225C, 14 }, { 0x26, 6 },
+ { 0x5E, 7 }, { 0x7, 3 }, { 0x6, 3 }, { 0x6, 4 },
+ { 0x7, 4 }, { 0x16, 5 }, { 0x2E, 6 }, { 0x45, 7 },
+ { 0x88, 8 }, { 0x113, 9 }, { 0x44A, 11 }, { 0x225F, 14 },
+ { 0x225E, 14 }, { 0x112D, 13 }, { 0x112C, 13 }, { 0x2, 3 },
+ { 0x2, 4 }, { 0x12, 5 }, { 0x3, 5 }, { 0x2, 5 },
+ { 0x3, 4 }, { 0x0, 4 }, { 0x10, 5 }, { 0x23, 6 }
+ },
+ { /* AC bias group 3, table 5 */
+ { 0xF, 4 }, { 0x6, 5 }, { 0x75, 7 }, { 0x74, 7 },
+ { 0xA, 9 }, { 0xBF, 13 }, { 0xB9, 13 }, { 0x22, 6 },
+ { 0x3, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1, 4 },
+ { 0x2, 4 }, { 0x7, 5 }, { 0x0, 6 }, { 0x4, 8 },
+ { 0x16, 10 }, { 0x5E, 12 }, { 0xB8, 13 }, { 0xBB, 13 },
+ { 0xBA, 13 }, { 0x17D, 14 }, { 0x17C, 14 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x1C, 5 }, { 0x10, 5 }, { 0x3B, 6 },
+ { 0x9, 4 }, { 0x7, 4 }, { 0x1, 5 }, { 0x23, 6 }
+ },
+ { /* AC bias group 3, table 6 */
+ { 0x1, 3 }, { 0x1C, 5 }, { 0x36, 6 }, { 0x3B, 6 },
+ { 0xEA, 8 }, { 0x75B, 11 }, { 0x1D65, 13 }, { 0x19, 6 },
+ { 0x74, 7 }, { 0x4, 3 }, { 0x5, 3 }, { 0x0, 4 },
+ { 0x1, 4 }, { 0x37, 6 }, { 0x1D7, 9 }, { 0x75A, 11 },
+ { 0x1D64, 13 }, { 0x1D67, 13 }, { 0x1D66, 13 }, { 0x1D61, 13 },
+ { 0x1D60, 13 }, { 0x1D63, 13 }, { 0x1D62, 13 }, { 0x2, 3 },
+ { 0x1F, 5 }, { 0x1A, 5 }, { 0xD, 5 }, { 0x3D, 6 },
+ { 0xC, 4 }, { 0x7, 4 }, { 0x3C, 6 }, { 0x18, 6 }
+ },
+ { /* AC bias group 3, table 7 */
+ { 0x2, 3 }, { 0x1, 4 }, { 0x14, 5 }, { 0x0, 4 },
+ { 0x2F, 6 }, { 0xBB, 8 }, { 0x2E4, 10 }, { 0x7D, 7 },
+ { 0xBA, 8 }, { 0x3, 3 }, { 0x4, 3 }, { 0x16, 5 },
+ { 0x1A, 5 }, { 0xB8, 8 }, { 0x172E, 13 }, { 0x2E5F, 14 },
+ { 0x2E5E, 14 }, { 0x1729, 13 }, { 0x1728, 13 }, { 0x172B, 13 },
+ { 0x172A, 13 }, { 0x172D, 13 }, { 0x172C, 13 }, { 0x1, 3 },
+ { 0x1E, 5 }, { 0x15, 5 }, { 0x1B, 5 }, { 0x3F, 6 },
+ { 0xC, 4 }, { 0xE, 4 }, { 0x7C, 7 }, { 0x173, 9 }
+ },
+ { /* AC bias group 3, table 8 */
+ { 0x3, 4 }, { 0x7B, 7 }, { 0x58, 8 }, { 0x1EA, 9 },
+ { 0x1EB1, 13 }, { 0x1EB0, 13 }, { 0x1EB3, 13 }, { 0x13, 6 },
+ { 0x12, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x13, 5 }, { 0x3C, 6 }, { 0x2D, 7 },
+ { 0xF4, 8 }, { 0x59, 8 }, { 0x3D7, 10 }, { 0xF5B, 12 },
+ { 0x1EB2, 13 }, { 0x1EB5, 13 }, { 0x1EB4, 13 }, { 0x3, 3 },
+ { 0xE, 4 }, { 0x1F, 5 }, { 0x12, 5 }, { 0x8, 5 },
+ { 0x8, 4 }, { 0x0, 4 }, { 0xA, 5 }, { 0x17, 6 }
+ },
+ { /* AC bias group 3, table 9 */
+ { 0x8, 4 }, { 0x3C, 6 }, { 0xF5, 8 }, { 0xF4, 8 },
+ { 0x1EF7, 13 }, { 0x3DE9, 14 }, { 0x3DE8, 14 }, { 0x1C, 6 },
+ { 0xD, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1, 4 },
+ { 0x0, 4 }, { 0x7, 5 }, { 0xC, 6 }, { 0xF6, 8 },
+ { 0x1EE, 9 }, { 0x3DF, 10 }, { 0x7BC, 11 }, { 0x3DEB, 14 },
+ { 0x3DEA, 14 }, { 0x3DED, 14 }, { 0x3DEC, 14 }, { 0x2, 3 },
+ { 0x9, 4 }, { 0x1F, 5 }, { 0xF, 5 }, { 0x5, 5 },
+ { 0xE, 4 }, { 0x6, 4 }, { 0x4, 5 }, { 0x1D, 6 }
+ },
+ { /* AC bias group 3, table 10 */
+ { 0x9, 4 }, { 0x39, 6 }, { 0x19, 7 }, { 0x18, 7 },
+ { 0x706, 11 }, { 0x383D, 14 }, { 0x383C, 14 }, { 0xD, 6 },
+ { 0xF, 6 }, { 0x5, 3 }, { 0x6, 3 }, { 0x0, 4 },
+ { 0x1D, 5 }, { 0x3, 5 }, { 0x71, 7 }, { 0xE1, 8 },
+ { 0x1C0, 9 }, { 0x382, 10 }, { 0x1C1D, 13 }, { 0x383F, 14 },
+ { 0x383E, 14 }, { 0x3839, 14 }, { 0x3838, 14 }, { 0x2, 3 },
+ { 0x8, 4 }, { 0x2, 4 }, { 0xD, 5 }, { 0xC, 5 },
+ { 0xF, 4 }, { 0x7, 4 }, { 0x2, 5 }, { 0xE, 6 }
+ },
+ { /* AC bias group 3, table 11 */
+ { 0x0, 3 }, { 0x6, 5 }, { 0x35, 7 }, { 0x34, 7 },
+ { 0x777, 11 }, { 0x1DD4, 13 }, { 0x3BAB, 14 }, { 0xE, 6 },
+ { 0xF, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x1C, 5 },
+ { 0x19, 5 }, { 0x3A, 6 }, { 0xEF, 8 }, { 0x1DC, 9 },
+ { 0x776, 11 }, { 0x774, 11 }, { 0x3BAA, 14 }, { 0x3BAD, 14 },
+ { 0x3BAC, 14 }, { 0x3BAF, 14 }, { 0x3BAE, 14 }, { 0x2, 3 },
+ { 0x7, 4 }, { 0x2, 4 }, { 0x18, 5 }, { 0xC, 5 },
+ { 0xF, 4 }, { 0xD, 4 }, { 0x1B, 6 }, { 0x76, 7 }
+ },
+ { /* AC bias group 3, table 12 */
+ { 0x2, 3 }, { 0x11, 5 }, { 0x6, 6 }, { 0x4F, 7 },
+ { 0x130, 9 }, { 0x1319, 13 }, { 0x1318, 13 }, { 0x4E, 7 },
+ { 0x7, 6 }, { 0x6, 3 }, { 0x5, 3 }, { 0x10, 5 },
+ { 0xD, 5 }, { 0x5, 6 }, { 0x99, 8 }, { 0x262, 10 },
+ { 0x98E, 12 }, { 0x131B, 13 }, { 0x131A, 13 }, { 0x263D, 14 },
+ { 0x263C, 14 }, { 0x263F, 14 }, { 0x263E, 14 }, { 0x1, 3 },
+ { 0x7, 4 }, { 0x0, 4 }, { 0x12, 5 }, { 0xC, 5 },
+ { 0xE, 4 }, { 0xF, 4 }, { 0x4, 6 }, { 0x4D, 7 }
+ },
+ { /* AC bias group 3, table 13 */
+ { 0x3, 3 }, { 0x0, 4 }, { 0x2, 5 }, { 0x37, 6 },
+ { 0x1B7, 9 }, { 0xDB5, 12 }, { 0x36DD, 14 }, { 0x6C, 7 },
+ { 0x16, 6 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 5 },
+ { 0xA, 5 }, { 0x2E, 7 }, { 0x36C, 10 }, { 0xDB4, 12 },
+ { 0x36DC, 14 }, { 0x36DF, 14 }, { 0x36DE, 14 }, { 0x36D9, 14 },
+ { 0x36D8, 14 }, { 0x36DB, 14 }, { 0x36DA, 14 }, { 0xE, 4 },
+ { 0x4, 4 }, { 0x1A, 5 }, { 0x19, 5 }, { 0x18, 5 },
+ { 0xF, 4 }, { 0x1, 3 }, { 0x2F, 7 }, { 0xDA, 8 }
+ },
+ { /* AC bias group 3, table 14 */
+ { 0x6, 3 }, { 0x6, 4 }, { 0xF, 5 }, { 0x0, 4 },
+ { 0x75, 7 }, { 0x3B8, 10 }, { 0x1DCA, 13 }, { 0x74, 7 },
+ { 0x76, 7 }, { 0x4, 3 }, { 0x5, 3 }, { 0x3, 5 },
+ { 0x2, 5 }, { 0x1DE, 9 }, { 0xEE6, 12 }, { 0x3B97, 14 },
+ { 0x3B96, 14 }, { 0x3B9D, 14 }, { 0x3B9C, 14 }, { 0x3B9F, 14 },
+ { 0x3B9E, 14 }, { 0x1DC9, 13 }, { 0x1DC8, 13 }, { 0x5, 4 },
+ { 0x1C, 5 }, { 0x9, 5 }, { 0xE, 5 }, { 0x8, 5 },
+ { 0xF, 4 }, { 0x1, 3 }, { 0x1DF, 9 }, { 0x1DD, 9 }
+ },
+ { /* AC bias group 3, table 15 */
+ { 0x4, 3 }, { 0xB, 4 }, { 0x1D, 5 }, { 0xC, 4 },
+ { 0x14, 5 }, { 0xE0, 8 }, { 0x3875, 14 }, { 0x386, 10 },
+ { 0x1C2, 9 }, { 0x0, 2 }, { 0x1, 2 }, { 0x71, 7 },
+ { 0x72, 7 }, { 0x1C3F, 13 }, { 0x3874, 14 }, { 0x3877, 14 },
+ { 0x3876, 14 }, { 0x3871, 14 }, { 0x3870, 14 }, { 0x3873, 14 },
+ { 0x3872, 14 }, { 0x3879, 14 }, { 0x3878, 14 }, { 0x3C, 6 },
+ { 0x73, 7 }, { 0x2A, 6 }, { 0x3D, 6 }, { 0x2B, 6 },
+ { 0x1F, 5 }, { 0xD, 4 }, { 0x1C3E, 13 }, { 0x1C3D, 13 }
+ }
+};
+
+static const uint16_t vp4_ac_bias_3[16][32][2] = {
+ { /* AC bias group 4, table 0 */
+ { 0x7, 4 }, { 0xF, 6 }, { 0xBB, 8 }, { 0xBA, 8 },
+ { 0x5CF, 11 }, { 0x173A, 13 }, { 0x2E77, 14 }, { 0x29, 6 },
+ { 0x172, 9 }, { 0x7, 3 }, { 0x6, 3 }, { 0x9, 4 },
+ { 0x8, 4 }, { 0x1, 4 }, { 0x5, 5 }, { 0xD, 6 },
+ { 0x1D, 7 }, { 0x1C, 7 }, { 0xB8, 8 }, { 0x2E6, 10 },
+ { 0x2E76, 14 }, { 0x1739, 13 }, { 0x1738, 13 }, { 0x2, 3 },
+ { 0x6, 4 }, { 0x16, 5 }, { 0x4, 5 }, { 0x28, 6 },
+ { 0x15, 5 }, { 0xC, 6 }, { 0x0, 4 }, { 0x2F, 6 }
+ },
+ { /* AC bias group 4, table 1 */
+ { 0xB, 4 }, { 0x2, 5 }, { 0x54, 7 }, { 0x2F, 7 },
+ { 0x2AC, 10 }, { 0x156B, 13 }, { 0x1568, 13 }, { 0x16, 6 },
+ { 0x154, 9 }, { 0x7, 3 }, { 0x6, 3 }, { 0x4, 4 },
+ { 0x3, 4 }, { 0x13, 5 }, { 0x28, 6 }, { 0x2E, 7 },
+ { 0x157, 9 }, { 0x155, 9 }, { 0x55B, 11 }, { 0x2AD3, 14 },
+ { 0x2AD2, 14 }, { 0x2AD5, 14 }, { 0x2AD4, 14 }, { 0x3, 3 },
+ { 0x8, 4 }, { 0x0, 4 }, { 0xA, 5 }, { 0x3, 5 },
+ { 0x2, 4 }, { 0x2B, 6 }, { 0x12, 5 }, { 0x29, 6 }
+ },
+ { /* AC bias group 4, table 2 */
+ { 0xF, 4 }, { 0x7, 5 }, { 0x1, 6 }, { 0x0, 6 },
+ { 0x1C4, 9 }, { 0x703, 11 }, { 0xE02, 12 }, { 0x11, 6 },
+ { 0xE1, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x2, 4 },
+ { 0x1, 4 }, { 0x9, 5 }, { 0x10, 6 }, { 0xE3, 8 },
+ { 0x1C5, 9 }, { 0x1C1, 9 }, { 0x702, 11 }, { 0x1C07, 13 },
+ { 0x1C06, 13 }, { 0xE01, 12 }, { 0xE00, 12 }, { 0x4, 3 },
+ { 0x7, 4 }, { 0x1D, 5 }, { 0xD, 5 }, { 0x1, 5 },
+ { 0x5, 4 }, { 0x6, 5 }, { 0xC, 5 }, { 0x39, 6 }
+ },
+ { /* AC bias group 4, table 3 */
+ { 0x1, 3 }, { 0x1C, 5 }, { 0x11, 6 }, { 0x13, 6 },
+ { 0x42, 8 }, { 0x207, 11 }, { 0x815, 13 }, { 0x75, 7 },
+ { 0x41, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x0, 4 },
+ { 0x1F, 5 }, { 0x3B, 6 }, { 0x74, 7 }, { 0x43, 8 },
+ { 0x80, 9 }, { 0x206, 11 }, { 0x814, 13 }, { 0x817, 13 },
+ { 0x816, 13 }, { 0x409, 12 }, { 0x408, 12 }, { 0x3, 3 },
+ { 0x9, 4 }, { 0x1E, 5 }, { 0x11, 5 }, { 0x3, 5 },
+ { 0x5, 4 }, { 0x10, 5 }, { 0x2, 5 }, { 0x12, 6 }
+ },
+ { /* AC bias group 4, table 4 */
+ { 0x1, 3 }, { 0x1F, 5 }, { 0x27, 6 }, { 0x1, 5 },
+ { 0x4B, 8 }, { 0x123, 10 }, { 0x915, 13 }, { 0x0, 6 },
+ { 0x49, 8 }, { 0x5, 3 }, { 0x6, 3 }, { 0x1D, 5 },
+ { 0x1C, 5 }, { 0x13, 6 }, { 0x4A, 8 }, { 0x90, 9 },
+ { 0x914, 13 }, { 0x917, 13 }, { 0x916, 13 }, { 0x911, 13 },
+ { 0x910, 13 }, { 0x913, 13 }, { 0x912, 13 }, { 0x3, 3 },
+ { 0x5, 4 }, { 0x1, 4 }, { 0x12, 5 }, { 0x8, 5 },
+ { 0x8, 4 }, { 0x1E, 5 }, { 0x26, 6 }, { 0x1, 6 }
+ },
+ { /* AC bias group 4, table 5 */
+ { 0x3, 3 }, { 0x1, 4 }, { 0x3F, 6 }, { 0xB, 5 },
+ { 0x4E, 7 }, { 0x132, 9 }, { 0x99A, 12 }, { 0x4F, 7 },
+ { 0x98, 8 }, { 0x6, 3 }, { 0x5, 3 }, { 0x1D, 5 },
+ { 0x1C, 5 }, { 0x7C, 7 }, { 0x267, 10 }, { 0x1331, 13 },
+ { 0x1330, 13 }, { 0x1333, 13 }, { 0x1332, 13 }, { 0x266D, 14 },
+ { 0x266C, 14 }, { 0x266F, 14 }, { 0x266E, 14 }, { 0x1, 3 },
+ { 0x4, 4 }, { 0x1E, 5 }, { 0x12, 5 }, { 0xA, 5 },
+ { 0x8, 4 }, { 0x0, 4 }, { 0x7D, 7 }, { 0x4D, 7 }
+ },
+ { /* AC bias group 4, table 6 */
+ { 0x2, 3 }, { 0x7, 4 }, { 0x15, 5 }, { 0x3, 4 },
+ { 0x4, 5 }, { 0xA7, 8 }, { 0x536, 11 }, { 0x28, 6 },
+ { 0x29A, 10 }, { 0x6, 3 }, { 0x4, 3 }, { 0x1C, 5 },
+ { 0x17, 5 }, { 0xA4, 8 }, { 0x29BE, 14 }, { 0x537F, 15 },
+ { 0x537E, 15 }, { 0x29B9, 14 }, { 0x29B8, 14 }, { 0x29BB, 14 },
+ { 0x29BA, 14 }, { 0x29BD, 14 }, { 0x29BC, 14 }, { 0xF, 4 },
+ { 0x0, 4 }, { 0x5, 5 }, { 0x16, 5 }, { 0x1D, 5 },
+ { 0x6, 4 }, { 0x1, 4 }, { 0xA5, 8 }, { 0x14C, 9 }
+ },
+ { /* AC bias group 4, table 7 */
+ { 0x4, 3 }, { 0x7, 4 }, { 0x1A, 5 }, { 0xC, 4 },
+ { 0x6, 4 }, { 0x29, 6 }, { 0x1BD, 9 }, { 0x1BE3, 13 },
+ { 0x1BE0, 13 }, { 0x0, 2 }, { 0x7, 3 }, { 0x6E, 7 },
+ { 0x1BC, 9 }, { 0x37C3, 14 }, { 0x37C2, 14 }, { 0x37CD, 14 },
+ { 0x37CC, 14 }, { 0x37CF, 14 }, { 0x37CE, 14 }, { 0x37C9, 14 },
+ { 0x37C8, 14 }, { 0x37CB, 14 }, { 0x37CA, 14 }, { 0x15, 5 },
+ { 0x1BF, 9 }, { 0x37D, 10 }, { 0x36, 6 }, { 0x2, 3 },
+ { 0xB, 4 }, { 0x28, 6 }, { 0x37C5, 14 }, { 0x37C4, 14 }
+ },
+ { /* AC bias group 4, table 8 */
+ { 0x1, 3 }, { 0x9, 5 }, { 0x3, 6 }, { 0x2, 6 },
+ { 0x11F, 10 }, { 0x8E9, 13 }, { 0x8E8, 13 }, { 0x2D, 7 },
+ { 0x22, 7 }, { 0x6, 3 }, { 0x7, 3 }, { 0x10, 5 },
+ { 0x11, 5 }, { 0x17, 6 }, { 0x2C, 7 }, { 0x46, 8 },
+ { 0x11E, 10 }, { 0x11C, 10 }, { 0x477, 12 }, { 0x8EB, 13 },
+ { 0x8EA, 13 }, { 0x8ED, 13 }, { 0x8EC, 13 }, { 0x3, 3 },
+ { 0xB, 4 }, { 0x1, 4 }, { 0x14, 5 }, { 0xA, 5 },
+ { 0x9, 4 }, { 0x15, 5 }, { 0x0, 5 }, { 0x10, 6 }
+ },
+ { /* AC bias group 4, table 9 */
+ { 0x1, 3 }, { 0x1D, 5 }, { 0x22, 6 }, { 0x13, 6 },
+ { 0x11E, 9 }, { 0x8FC, 12 }, { 0x23F5, 14 }, { 0x23, 7 },
+ { 0x22, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x10, 5 },
+ { 0xB, 5 }, { 0x10, 6 }, { 0x8E, 8 }, { 0x23E, 10 },
+ { 0x8FF, 12 }, { 0x11FD, 13 }, { 0x23F4, 14 }, { 0x23F7, 14 },
+ { 0x23F6, 14 }, { 0x23F9, 14 }, { 0x23F8, 14 }, { 0x3, 3 },
+ { 0x9, 4 }, { 0x0, 4 }, { 0x1C, 5 }, { 0xA, 5 },
+ { 0xF, 4 }, { 0x1, 4 }, { 0x12, 6 }, { 0x46, 7 }
+ },
+ { /* AC bias group 4, table 10 */
+ { 0x3, 3 }, { 0x1F, 5 }, { 0x3C, 6 }, { 0x3D, 6 },
+ { 0x86, 8 }, { 0x877, 12 }, { 0x10E8, 13 }, { 0x41, 7 },
+ { 0x40, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x7, 5 },
+ { 0x6, 5 }, { 0x4, 6 }, { 0x10F, 9 }, { 0x21C, 10 },
+ { 0x875, 12 }, { 0x21D3, 14 }, { 0x21D2, 14 }, { 0x21D9, 14 },
+ { 0x21D8, 14 }, { 0x21DB, 14 }, { 0x21DA, 14 }, { 0x2, 3 },
+ { 0x9, 4 }, { 0x0, 4 }, { 0x11, 5 }, { 0x3, 5 },
+ { 0xE, 4 }, { 0x2, 4 }, { 0x5, 6 }, { 0x42, 7 }
+ },
+ { /* AC bias group 4, table 11 */
+ { 0x4, 3 }, { 0x1, 4 }, { 0x3D, 6 }, { 0x9, 5 },
+ { 0xF3, 8 }, { 0x793, 11 }, { 0x1E45, 13 }, { 0x0, 7 },
+ { 0x2, 7 }, { 0x5, 3 }, { 0x6, 3 }, { 0x8, 5 },
+ { 0x1, 5 }, { 0x3, 7 }, { 0x1E5, 9 }, { 0x792, 11 },
+ { 0x1E44, 13 }, { 0x1E47, 13 }, { 0x1E46, 13 }, { 0x1E41, 13 },
+ { 0x1E40, 13 }, { 0x1E43, 13 }, { 0x1E42, 13 }, { 0x1, 3 },
+ { 0x6, 4 }, { 0x1F, 5 }, { 0xF, 5 }, { 0xE, 5 },
+ { 0xE, 4 }, { 0x5, 4 }, { 0x78, 7 }, { 0x1, 7 }
+ },
+ { /* AC bias group 4, table 12 */
+ { 0x4, 3 }, { 0x5, 4 }, { 0xE, 5 }, { 0x17, 5 },
+ { 0x3E, 7 }, { 0xF0, 9 }, { 0xF1E, 13 }, { 0x7A, 8 },
+ { 0x7F, 8 }, { 0x6, 3 }, { 0x7, 3 }, { 0x5, 5 },
+ { 0x4, 5 }, { 0x7B, 8 }, { 0x1E2, 10 }, { 0x1E3F, 14 },
+ { 0x1E3E, 14 }, { 0xF19, 13 }, { 0xF18, 13 }, { 0xF1B, 13 },
+ { 0xF1A, 13 }, { 0xF1D, 13 }, { 0xF1C, 13 }, { 0x0, 3 },
+ { 0x3, 4 }, { 0x16, 5 }, { 0x9, 5 }, { 0x8, 5 },
+ { 0xA, 4 }, { 0x6, 4 }, { 0x7E, 8 }, { 0x79, 8 }
+ },
+ { /* AC bias group 4, table 13 */
+ { 0x5, 3 }, { 0xC, 4 }, { 0x1A, 5 }, { 0x4, 4 },
+ { 0x1A, 6 }, { 0xDE, 9 }, { 0xDF4, 13 }, { 0xDD, 9 },
+ { 0x6D, 8 }, { 0x0, 2 }, { 0x7, 3 }, { 0x25, 6 },
+ { 0x24, 6 }, { 0xDC, 9 }, { 0xDF7, 13 }, { 0x1BEB, 14 },
+ { 0x1BEA, 14 }, { 0xDF1, 13 }, { 0xDF0, 13 }, { 0xDF3, 13 },
+ { 0xDF2, 13 }, { 0x1BED, 14 }, { 0x1BEC, 14 }, { 0x8, 4 },
+ { 0x13, 5 }, { 0xC, 5 }, { 0x37, 6 }, { 0x36, 6 },
+ { 0x5, 4 }, { 0x7, 4 }, { 0x6C, 8 }, { 0x1BF, 10 }
+ },
+ { /* AC bias group 4, table 14 */
+ { 0x5, 3 }, { 0xD, 4 }, { 0x1F, 5 }, { 0xC, 4 },
+ { 0x3B, 6 }, { 0x40, 7 }, { 0x41A, 11 }, { 0x104, 9 },
+ { 0x107, 9 }, { 0x1, 2 }, { 0x0, 2 }, { 0x24, 6 },
+ { 0x21, 6 }, { 0x20B, 10 }, { 0x106E, 13 }, { 0x20DF, 14 },
+ { 0x20DE, 14 }, { 0x1055, 13 }, { 0x1054, 13 }, { 0x1057, 13 },
+ { 0x1056, 13 }, { 0x106D, 13 }, { 0x106C, 13 }, { 0x11, 5 },
+ { 0x3A, 6 }, { 0x25, 6 }, { 0x38, 6 }, { 0x39, 6 },
+ { 0x13, 5 }, { 0x1E, 5 }, { 0x20C, 10 }, { 0x414, 11 }
+ },
+ { /* AC bias group 4, table 15 */
+ { 0x0, 2 }, { 0x7, 4 }, { 0xD, 5 }, { 0x5, 4 },
+ { 0x9, 5 }, { 0x22, 7 }, { 0xCD1, 13 }, { 0xCD0, 13 },
+ { 0xCD3, 13 }, { 0x3, 2 }, { 0x2, 2 }, { 0x8D, 9 },
+ { 0xCC, 9 }, { 0x66B, 12 }, { 0xCD2, 13 }, { 0x19B5, 14 },
+ { 0x19B4, 14 }, { 0x19B7, 14 }, { 0x19B6, 14 }, { 0x19B1, 14 },
+ { 0x19B0, 14 }, { 0x19B3, 14 }, { 0x19B2, 14 }, { 0x47, 8 },
+ { 0x8C, 9 }, { 0x337, 11 }, { 0x67, 8 }, { 0x18, 6 },
+ { 0x10, 6 }, { 0x32, 7 }, { 0xCD5, 13 }, { 0xCD4, 13 }
+ }
+};
+
+#endif /* AVCODEC_VP4DATA_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9.c b/chromium/third_party/ffmpeg/libavcodec/vp9.c
index acf3ffc9e73..f16462b1e9d 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9.c
@@ -353,7 +353,7 @@ static av_always_inline int inv_recenter_nonneg(int v, int m)
// differential forward probability updates
static int update_prob(VP56RangeCoder *c, int p)
{
- static const int inv_map_table[255] = {
+ static const uint8_t inv_map_table[255] = {
7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176,
189, 202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24,
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9_metadata_bsf.c b/chromium/third_party/ffmpeg/libavcodec/vp9_metadata_bsf.c
index b79f08af6c3..1bde1b96aaf 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9_metadata_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9_metadata_bsf.c
@@ -37,18 +37,17 @@ typedef struct VP9MetadataContext {
} VP9MetadataContext;
-static int vp9_metadata_filter(AVBSFContext *bsf, AVPacket *out)
+static int vp9_metadata_filter(AVBSFContext *bsf, AVPacket *pkt)
{
VP9MetadataContext *ctx = bsf->priv_data;
- AVPacket *in = NULL;
CodedBitstreamFragment *frag = &ctx->fragment;
int err, i;
- err = ff_bsf_get_packet(bsf, &in);
+ err = ff_bsf_get_packet_ref(bsf, pkt);
if (err < 0)
return err;
- err = ff_cbs_read_packet(ctx->cbc, frag, in);
+ err = ff_cbs_read_packet(ctx->cbc, frag, pkt);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to read packet.\n");
goto fail;
@@ -74,23 +73,18 @@ static int vp9_metadata_filter(AVBSFContext *bsf, AVPacket *out)
}
}
- err = ff_cbs_write_packet(ctx->cbc, out, frag);
+ err = ff_cbs_write_packet(ctx->cbc, pkt, frag);
if (err < 0) {
av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
goto fail;
}
- err = av_packet_copy_props(out, in);
- if (err < 0)
- goto fail;
-
err = 0;
fail:
ff_cbs_fragment_reset(ctx->cbc, frag);
if (err < 0)
- av_packet_unref(out);
- av_packet_free(&in);
+ av_packet_unref(pkt);
return err;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9_raw_reorder_bsf.c b/chromium/third_party/ffmpeg/libavcodec/vp9_raw_reorder_bsf.c
index 01f3dad8982..f19b4c71980 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9_raw_reorder_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9_raw_reorder_bsf.c
@@ -385,6 +385,16 @@ fail:
return err;
}
+static void vp9_raw_reorder_flush(AVBSFContext *bsf)
+{
+ VP9RawReorderContext *ctx = bsf->priv_data;
+
+ for (int s = 0; s < FRAME_SLOTS; s++)
+ vp9_raw_reorder_clear_slot(ctx, s);
+ ctx->next_frame = NULL;
+ ctx->sequence = 0;
+}
+
static void vp9_raw_reorder_close(AVBSFContext *bsf)
{
VP9RawReorderContext *ctx = bsf->priv_data;
@@ -402,6 +412,7 @@ const AVBitStreamFilter ff_vp9_raw_reorder_bsf = {
.name = "vp9_raw_reorder",
.priv_data_size = sizeof(VP9RawReorderContext),
.close = &vp9_raw_reorder_close,
+ .flush = &vp9_raw_reorder_flush,
.filter = &vp9_raw_reorder_filter,
.codec_ids = vp9_raw_reorder_codec_ids,
};
diff --git a/chromium/third_party/ffmpeg/libavcodec/vp9_superframe_bsf.c b/chromium/third_party/ffmpeg/libavcodec/vp9_superframe_bsf.c
index ea6750750b0..23933d41365 100644
--- a/chromium/third_party/ffmpeg/libavcodec/vp9_superframe_bsf.c
+++ b/chromium/third_party/ffmpeg/libavcodec/vp9_superframe_bsf.c
@@ -133,7 +133,7 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
if (uses_superframe_syntax && s->n_cache > 0) {
av_log(ctx, AV_LOG_ERROR,
- "Mixing of superframe syntax and naked VP9 frames not supported");
+ "Mixing of superframe syntax and naked VP9 frames not supported\n");
res = AVERROR(ENOSYS);
goto done;
} else if ((!invisible || uses_superframe_syntax) && !s->n_cache) {
@@ -142,7 +142,7 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
goto done;
} else if (s->n_cache + 1 >= MAX_CACHE) {
av_log(ctx, AV_LOG_ERROR,
- "Too many invisible frames");
+ "Too many invisible frames\n");
res = AVERROR_INVALIDDATA;
goto done;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
index 979b92165b2..95f4b6530c2 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.c
@@ -637,21 +637,15 @@ static void reverse_mono_decorr(struct Decorr *dpp)
}
}
+#define count_bits(av) ((av) ? 32 - ff_clz(av) : 0)
+
static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
{
- uint32_t dbits;
+ uint32_t dbits = count_bits(v);
if ((v += v >> 9) < (1 << 8)) {
- dbits = nbits_table[v];
*result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
} else {
- if (v < (1 << 16))
- dbits = nbits_table[v >> 8] + 8;
- else if (v < (1 << 24))
- dbits = nbits_table[v >> 16] + 16;
- else
- dbits = nbits_table[v >> 24] + 24;
-
*result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
if (limit && dbits >= limit)
@@ -1969,14 +1963,6 @@ static int wv_stereo(WavPackEncodeContext *s,
return 0;
}
-#define count_bits(av) ( \
- (av) < (1 << 8) ? nbits_table[av] : \
- ( \
- (av) < (1 << 16) ? nbits_table[(av) >> 8] + 8 : \
- ((av) < (1 << 24) ? nbits_table[(av) >> 16] + 16 : nbits_table[(av) >> 24] + 24) \
- ) \
-)
-
static void encode_flush(WavPackEncodeContext *s)
{
WavPackWords *w = &s->w;
diff --git a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.h b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.h
index 9dd2a01bbe5..11914337cfe 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wavpackenc.h
+++ b/chromium/third_party/ffmpeg/libavcodec/wavpackenc.h
@@ -650,15 +650,4 @@ static const uint16_t decorr_filter_sizes[] = {
static const uint8_t decorr_filter_nterms[] = { 2, 5, 10, 16 };
-static const int8_t nbits_table[] = {
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
-};
-
#endif /* AVCODEC_WAVPACKENC_H */
diff --git a/chromium/third_party/ffmpeg/libavcodec/wcmv.c b/chromium/third_party/ffmpeg/libavcodec/wcmv.c
index 2988c15b23a..0d60b9fe1fc 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wcmv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wcmv.c
@@ -154,6 +154,9 @@ static int decode_frame(AVCodecContext *avctx,
bytestream2_seek(&gb, 2, SEEK_SET);
}
+ if (bytestream2_get_bytes_left(&gb) < 8LL * blocks)
+ return AVERROR_INVALIDDATA;
+
if (s->prev_frame->data[0]) {
ret = av_frame_copy(frame, s->prev_frame);
if (ret < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
index 124dfdb7e00..afa65478e34 100644
--- a/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/wmv2dec.c
@@ -33,6 +33,7 @@
static int parse_mb_skip(Wmv2Context *w)
{
int mb_x, mb_y;
+ int coded_mb_count = 0;
MpegEncContext *const s = &w->s;
uint32_t *const mb_type = s->current_picture_ptr->mb_type;
@@ -83,6 +84,14 @@ static int parse_mb_skip(Wmv2Context *w)
}
break;
}
+
+ for (mb_y = 0; mb_y < s->mb_height; mb_y++)
+ for (mb_x = 0; mb_x < s->mb_width; mb_x++)
+ coded_mb_count += !IS_SKIP(mb_type[mb_y * s->mb_stride + mb_x]);
+
+ if (coded_mb_count > get_bits_left(&s->gb))
+ return AVERROR_INVALIDDATA;
+
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
index f63f7cfed3c..194135dafb3 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/Makefile
@@ -57,6 +57,7 @@ OBJS-$(CONFIG_OPUS_DECODER) += x86/opusdsp_init.o
OBJS-$(CONFIG_OPUS_ENCODER) += x86/celt_pvq_init.o
OBJS-$(CONFIG_HEVC_DECODER) += x86/hevcdsp_init.o
OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp_init.o
+OBJS-$(CONFIG_LSCR_DECODER) += x86/pngdsp_init.o
OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp_init.o
OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct_init.o
OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o
@@ -168,6 +169,7 @@ X86ASM-OBJS-$(CONFIG_HEVC_DECODER) += x86/hevc_add_res.o \
x86/hevc_sao.o \
x86/hevc_sao_10bit.o
X86ASM-OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp.o
+X86ASM-OBJS-$(CONFIG_LSCR_DECODER) += x86/pngdsp.o
X86ASM-OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
X86ASM-OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct.o
X86ASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/opusdsp.asm b/chromium/third_party/ffmpeg/libavcodec/x86/opusdsp.asm
index 6c99821b898..f5d206a8b15 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/opusdsp.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/opusdsp.asm
@@ -24,9 +24,6 @@ SECTION_RODATA
; 0.85..^1 0.85..^2 0.85..^3 0.85..^4
tab_st: dd 0x3f599a00, 0x3f38f671, 0x3f1d382a, 0x3f05a32f
-tab_x0: dd 0x0, 0x3f599a00, 0x3f599a00, 0x3f599a00
-tab_x1: dd 0x0, 0x0, 0x3f38f671, 0x3f38f671
-tab_x2: dd 0x0, 0x0, 0x0, 0x3f1d382a
SECTION .text
@@ -45,9 +42,9 @@ cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
%endif
movaps m4, [tab_st]
- movaps m5, [tab_x0]
- movaps m6, [tab_x1]
- movaps m7, [tab_x2]
+ VBROADCASTSS m5, m4
+ shufps m6, m4, m4, q1111
+ shufps m7, m4, m4, q2222
.loop:
movaps m1, [inq] ; x0, x1, x2, x3
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c b/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
index d64dbca1a8a..cb9a6cbd6a1 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/v210-init.c
@@ -21,9 +21,11 @@
extern void ff_v210_planar_unpack_unaligned_ssse3(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
extern void ff_v210_planar_unpack_unaligned_avx(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
+extern void ff_v210_planar_unpack_unaligned_avx2(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
extern void ff_v210_planar_unpack_aligned_ssse3(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
extern void ff_v210_planar_unpack_aligned_avx(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
+extern void ff_v210_planar_unpack_aligned_avx2(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width);
av_cold void ff_v210_x86_init(V210DecContext *s)
{
@@ -36,6 +38,9 @@ av_cold void ff_v210_x86_init(V210DecContext *s)
if (HAVE_AVX_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX)
s->unpack_frame = ff_v210_planar_unpack_aligned_avx;
+
+ if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2)
+ s->unpack_frame = ff_v210_planar_unpack_aligned_avx2;
}
else {
if (cpu_flags & AV_CPU_FLAG_SSSE3)
@@ -43,6 +48,9 @@ av_cold void ff_v210_x86_init(V210DecContext *s)
if (HAVE_AVX_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX)
s->unpack_frame = ff_v210_planar_unpack_unaligned_avx;
+
+ if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2)
+ s->unpack_frame = ff_v210_planar_unpack_unaligned_avx2;
}
#endif
}
diff --git a/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm b/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
index c24c765e5bb..3b9e0761df6 100644
--- a/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
+++ b/chromium/third_party/ffmpeg/libavcodec/x86/v210.asm
@@ -22,9 +22,14 @@
%include "libavutil/x86/x86util.asm"
-SECTION_RODATA
+SECTION_RODATA 32
+
+; for AVX2 version only
+v210_luma_permute: dd 0,1,2,4,5,6,7,7 ; 32-byte alignment required
+v210_chroma_shuf2: db 0,1,2,3,4,5,8,9,10,11,12,13,-1,-1,-1,-1
+v210_luma_shuf_avx2: db 0,1,4,5,6,7,8,9,12,13,14,15,-1,-1,-1,-1
+v210_chroma_shuf_avx2: db 0,1,4,5,10,11,-1,-1,2,3,8,9,12,13,-1,-1
-v210_mask: times 4 dd 0x3ff
v210_mult: dw 64,4,64,4,64,4,64,4
v210_luma_shuf: db 8,9,0,1,2,3,12,13,4,5,6,7,-1,-1,-1,-1
v210_chroma_shuf: db 0,1,8,9,6,7,-1,-1,2,3,4,5,12,13,-1,-1
@@ -34,40 +39,64 @@ SECTION .text
%macro v210_planar_unpack 1
; v210_planar_unpack(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width)
-cglobal v210_planar_unpack_%1, 5, 5, 7
- movsxdifnidn r4, r4d
- lea r1, [r1+2*r4]
- add r2, r4
- add r3, r4
- neg r4
-
- mova m3, [v210_mult]
- mova m4, [v210_mask]
- mova m5, [v210_luma_shuf]
- mova m6, [v210_chroma_shuf]
+cglobal v210_planar_unpack_%1, 5, 5, 6 + 2 * cpuflag(avx2), src, y, u, v, w
+ movsxdifnidn wq, wd
+ lea yq, [yq+2*wq]
+ add uq, wq
+ add vq, wq
+ neg wq
+
+ VBROADCASTI128 m3, [v210_mult]
+
+%if cpuflag(avx2)
+ VBROADCASTI128 m4, [v210_luma_shuf_avx2]
+ VBROADCASTI128 m5, [v210_chroma_shuf_avx2]
+ mova m6, [v210_luma_permute]
+ VBROADCASTI128 m7, [v210_chroma_shuf2]
+%else
+ VBROADCASTI128 m4, [v210_luma_shuf]
+ VBROADCASTI128 m5, [v210_chroma_shuf]
+%endif
+
.loop:
%ifidn %1, unaligned
- movu m0, [r0]
+ movu m0, [srcq] ; yB v5 yA u5 y9 v4 y8 u4 y7 v3 y6 u3 y5 v2 y4 u2 y3 v1 y2 u1 y1 v0 y0 u0
%else
- mova m0, [r0]
+ mova m0, [srcq]
%endif
pmullw m1, m0, m3
- psrld m0, 10
- psrlw m1, 6 ; u0 v0 y1 y2 v1 u2 y4 y5
- pand m0, m4 ; y0 __ u1 __ y3 __ v2 __
+ pslld m0, 12
+ psrlw m1, 6 ; yB yA u5 v4 y8 y7 v3 u3 y5 y4 u2 v1 y2 y1 v0 u0
+ psrld m0, 22 ; 00 v5 00 y9 00 u4 00 y6 00 v2 00 y3 00 u1 00 y0
+
+%if cpuflag(avx2)
+ vpblendd m2, m1, m0, 0x55 ; yB yA 00 y9 y8 y7 00 y6 y5 y4 00 y3 y2 y1 00 y0
+ pshufb m2, m4 ; 00 00 yB yA y9 y8 y7 y6 00 00 y5 y4 y3 y2 y1 y0
+ vpermd m2, m6, m2 ; 00 00 00 00 yB yA y9 y8 y7 y6 y5 y4 y3 y2 y1 y0
+ movu [yq+2*wq], m2
+
+ vpblendd m1, m1, m0, 0xaa ; 00 v5 u5 v4 00 u4 v3 u3 00 v2 u2 v1 00 u1 v0 u0
+ pshufb m1, m5 ; 00 v5 v4 v3 00 u5 u4 u3 00 v2 v1 v0 00 u2 u1 u0
+ vpermq m1, m1, 0xd8 ; 00 v5 v4 v3 00 v2 v1 v0 00 u5 u4 u3 00 u2 u1 u0
+ pshufb m1, m7 ; 00 00 v5 v4 v3 v2 v1 v0 00 00 u5 u4 u3 u2 u1 u0
+
+ movu [uq+wq], xm1
+ vextracti128 [vq+wq], m1, 1
+%else
+ shufps m2, m1, m0, 0x8d ; 00 y9 00 y6 yB yA y8 y7 00 y3 00 y0 y5 y4 y2 y1
+ pshufb m2, m4 ; 00 00 yB yA y9 y8 y7 y6 00 00 y5 y4 y3 y2 y1 y0
+ movu [yq+2*wq], m2
- shufps m2, m1, m0, 0x8d ; y1 y2 y4 y5 y0 __ y3 __
- pshufb m2, m5 ; y0 y1 y2 y3 y4 y5 __ __
- movu [r1+2*r4], m2
+ shufps m1, m0, 0xd8 ; 00 v5 00 u4 u5 v4 v3 u3 00 v2 00 u1 u2 v1 v0 u0
+ pshufb m1, m5 ; 00 v5 v4 v3 00 u5 u4 u3 00 v2 v1 v0 00 u2 u1 u0
- shufps m1, m0, 0xd8 ; u0 v0 v1 u2 u1 __ v2 __
- pshufb m1, m6 ; u0 u1 u2 __ v0 v1 v2 __
- movq [r2+r4], m1
- movhps [r3+r4], m1
+ movq [uq+wq], m1
+ movhps [vq+wq], m1
+%endif
- add r0, mmsize
- add r4, 6
+ add srcq, mmsize
+ add wq, (mmsize*3)/8
jl .loop
REP_RET
@@ -81,6 +110,11 @@ INIT_XMM avx
v210_planar_unpack unaligned
%endif
+%if HAVE_AVX2_EXTERNAL
+INIT_YMM avx2
+v210_planar_unpack unaligned
+%endif
+
INIT_XMM ssse3
v210_planar_unpack aligned
@@ -88,3 +122,8 @@ v210_planar_unpack aligned
INIT_XMM avx
v210_planar_unpack aligned
%endif
+
+%if HAVE_AVX2_EXTERNAL
+INIT_YMM avx2
+v210_planar_unpack aligned
+%endif
diff --git a/chromium/third_party/ffmpeg/libavcodec/xpmdec.c b/chromium/third_party/ffmpeg/libavcodec/xpmdec.c
index 43dd9bc7e7e..922dfc0f672 100644
--- a/chromium/third_party/ffmpeg/libavcodec/xpmdec.c
+++ b/chromium/third_party/ffmpeg/libavcodec/xpmdec.c
@@ -311,6 +311,7 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
int ncolors, cpp, ret, i, j;
int64_t size;
uint32_t *dst;
+ int width, height;
avctx->pix_fmt = AV_PIX_FMT_BGRA;
@@ -332,12 +333,12 @@ static int xpm_decode_frame(AVCodecContext *avctx, void *data,
ptr += mod_strcspn(ptr, "\"");
if (sscanf(ptr, "\"%u %u %u %u\",",
- &avctx->width, &avctx->height, &ncolors, &cpp) != 4) {
+ &width, &height, &ncolors, &cpp) != 4) {
av_log(avctx, AV_LOG_ERROR, "missing image parameters\n");
return AVERROR_INVALIDDATA;
}
- if ((ret = ff_set_dimensions(avctx, avctx->width, avctx->height)) < 0)
+ if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
diff --git a/chromium/third_party/ffmpeg/libavcodec/zmbv.c b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
index 898b62d0658..99e735cfd93 100644
--- a/chromium/third_party/ffmpeg/libavcodec/zmbv.c
+++ b/chromium/third_party/ffmpeg/libavcodec/zmbv.c
@@ -121,6 +121,8 @@ static int zmbv_decode_xor_8(ZmbvContext *c)
for (j = 0; j < bh2; j++) {
if (my + j < 0 || my + j >= c->height) {
memset(out, 0, bw2);
+ } else if (mx >= 0 && mx + bw2 <= c->width){
+ memcpy(out, tprev, sizeof(*out) * bw2);
} else {
for (i = 0; i < bw2; i++) {
if (mx + i < 0 || mx + i >= c->width)
@@ -193,6 +195,8 @@ static int zmbv_decode_xor_16(ZmbvContext *c)
for (j = 0; j < bh2; j++) {
if (my + j < 0 || my + j >= c->height) {
memset(out, 0, bw2 * 2);
+ } else if (mx >= 0 && mx + bw2 <= c->width){
+ memcpy(out, tprev, sizeof(*out) * bw2);
} else {
for (i = 0; i < bw2; i++) {
if (mx + i < 0 || mx + i >= c->width)
@@ -270,6 +274,8 @@ static int zmbv_decode_xor_24(ZmbvContext *c)
for (j = 0; j < bh2; j++) {
if (my + j < 0 || my + j >= c->height) {
memset(out, 0, bw2 * 3);
+ } else if (mx >= 0 && mx + bw2 <= c->width){
+ memcpy(out, tprev, 3 * bw2);
} else {
for (i = 0; i < bw2; i++){
if (mx + i < 0 || mx + i >= c->width) {
@@ -351,6 +357,8 @@ static int zmbv_decode_xor_32(ZmbvContext *c)
for (j = 0; j < bh2; j++) {
if (my + j < 0 || my + j >= c->height) {
memset(out, 0, bw2 * 4);
+ } else if (mx >= 0 && mx + bw2 <= c->width){
+ memcpy(out, tprev, sizeof(*out) * bw2);
} else {
for (i = 0; i < bw2; i++){
if (mx + i < 0 || mx + i >= c->width)
diff --git a/chromium/third_party/ffmpeg/libavdevice/alsa.c b/chromium/third_party/ffmpeg/libavdevice/alsa.c
index 1b21beb6d51..117b2ea144e 100644
--- a/chromium/third_party/ffmpeg/libavdevice/alsa.c
+++ b/chromium/third_party/ffmpeg/libavdevice/alsa.c
@@ -300,8 +300,10 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
{
AlsaData *s = s1->priv_data;
- snd_pcm_nonblock(s->h, 0);
- snd_pcm_drain(s->h);
+ if (snd_pcm_stream(s->h) == SND_PCM_STREAM_PLAYBACK) {
+ snd_pcm_nonblock(s->h, 0);
+ snd_pcm_drain(s->h);
+ }
av_freep(&s->reorder_buf);
if (CONFIG_ALSA_INDEV)
ff_timefilter_destroy(s->timefilter);
diff --git a/chromium/third_party/ffmpeg/libavdevice/avfoundation.m b/chromium/third_party/ffmpeg/libavdevice/avfoundation.m
index 98552ac29d4..08deecfeeab 100644
--- a/chromium/third_party/ffmpeg/libavdevice/avfoundation.m
+++ b/chromium/third_party/ffmpeg/libavdevice/avfoundation.m
@@ -97,6 +97,8 @@ typedef struct
int capture_cursor;
int capture_mouse_clicks;
+ int capture_raw_data;
+ int video_is_muxed;
int list_devices;
int video_device_index;
@@ -291,51 +293,65 @@ static int configure_video_device(AVFormatContext *s, AVCaptureDevice *video_dev
NSObject *selected_range = nil;
NSObject *selected_format = nil;
- for (format in [video_device valueForKey:@"formats"]) {
- CMFormatDescriptionRef formatDescription;
- CMVideoDimensions dimensions;
+ // try to configure format by formats list
+ // might raise an exception if no format list is given
+ // (then fallback to default, no configuration)
+ @try {
+ for (format in [video_device valueForKey:@"formats"]) {
+ CMFormatDescriptionRef formatDescription;
+ CMVideoDimensions dimensions;
- formatDescription = (CMFormatDescriptionRef) [format performSelector:@selector(formatDescription)];
- dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription);
+ formatDescription = (CMFormatDescriptionRef) [format performSelector:@selector(formatDescription)];
+ dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription);
- if ((ctx->width == 0 && ctx->height == 0) ||
- (dimensions.width == ctx->width && dimensions.height == ctx->height)) {
+ if ((ctx->width == 0 && ctx->height == 0) ||
+ (dimensions.width == ctx->width && dimensions.height == ctx->height)) {
- selected_format = format;
+ selected_format = format;
- for (range in [format valueForKey:@"videoSupportedFrameRateRanges"]) {
- double max_framerate;
+ for (range in [format valueForKey:@"videoSupportedFrameRateRanges"]) {
+ double max_framerate;
- [[range valueForKey:@"maxFrameRate"] getValue:&max_framerate];
- if (fabs (framerate - max_framerate) < 0.01) {
- selected_range = range;
- break;
+ [[range valueForKey:@"maxFrameRate"] getValue:&max_framerate];
+ if (fabs (framerate - max_framerate) < 0.01) {
+ selected_range = range;
+ break;
+ }
}
}
}
- }
- if (!selected_format) {
- av_log(s, AV_LOG_ERROR, "Selected video size (%dx%d) is not supported by the device\n",
- ctx->width, ctx->height);
- goto unsupported_format;
- }
-
- if (!selected_range) {
- av_log(s, AV_LOG_ERROR, "Selected framerate (%f) is not supported by the device\n",
- framerate);
- goto unsupported_format;
- }
+ if (!selected_format) {
+ av_log(s, AV_LOG_ERROR, "Selected video size (%dx%d) is not supported by the device.\n",
+ ctx->width, ctx->height);
+ goto unsupported_format;
+ }
- if ([video_device lockForConfiguration:NULL] == YES) {
- NSValue *min_frame_duration = [selected_range valueForKey:@"minFrameDuration"];
+ if (!selected_range) {
+ av_log(s, AV_LOG_ERROR, "Selected framerate (%f) is not supported by the device.\n",
+ framerate);
+ if (ctx->video_is_muxed) {
+ av_log(s, AV_LOG_ERROR, "Falling back to default.\n");
+ } else {
+ goto unsupported_format;
+ }
+ }
- [video_device setValue:selected_format forKey:@"activeFormat"];
- [video_device setValue:min_frame_duration forKey:@"activeVideoMinFrameDuration"];
- [video_device setValue:min_frame_duration forKey:@"activeVideoMaxFrameDuration"];
- } else {
- av_log(s, AV_LOG_ERROR, "Could not lock device for configuration");
- return AVERROR(EINVAL);
+ if ([video_device lockForConfiguration:NULL] == YES) {
+ if (selected_format) {
+ [video_device setValue:selected_format forKey:@"activeFormat"];
+ }
+ if (selected_range) {
+ NSValue *min_frame_duration = [selected_range valueForKey:@"minFrameDuration"];
+ [video_device setValue:min_frame_duration forKey:@"activeVideoMinFrameDuration"];
+ [video_device setValue:min_frame_duration forKey:@"activeVideoMaxFrameDuration"];
+ }
+ } else {
+ av_log(s, AV_LOG_ERROR, "Could not lock device for configuration.\n");
+ return AVERROR(EINVAL);
+ }
+ } @catch(NSException *e) {
+ av_log(ctx, AV_LOG_WARNING, "Configuration of video device failed, falling back to default.\n");
}
return 0;
@@ -468,12 +484,18 @@ static int add_video_device(AVFormatContext *s, AVCaptureDevice *video_device)
}
}
- ctx->pixel_format = pxl_fmt_spec.ff_id;
- pixel_format = [NSNumber numberWithUnsignedInt:pxl_fmt_spec.avf_id];
- capture_dict = [NSDictionary dictionaryWithObject:pixel_format
- forKey:(id)kCVPixelBufferPixelFormatTypeKey];
+ // set videoSettings to an empty dict for receiving raw data of muxed devices
+ if (ctx->capture_raw_data) {
+ ctx->pixel_format = pxl_fmt_spec.ff_id;
+ ctx->video_output.videoSettings = @{ };
+ } else {
+ ctx->pixel_format = pxl_fmt_spec.ff_id;
+ pixel_format = [NSNumber numberWithUnsignedInt:pxl_fmt_spec.avf_id];
+ capture_dict = [NSDictionary dictionaryWithObject:pixel_format
+ forKey:(id)kCVPixelBufferPixelFormatTypeKey];
- [ctx->video_output setVideoSettings:capture_dict];
+ [ctx->video_output setVideoSettings:capture_dict];
+ }
[ctx->video_output setAlwaysDiscardsLateVideoFrames:YES];
ctx->avf_delegate = [[AVFFrameReceiver alloc] initWithContext:ctx];
@@ -540,6 +562,7 @@ static int get_video_config(AVFormatContext *s)
{
AVFContext *ctx = (AVFContext*)s->priv_data;
CVImageBufferRef image_buffer;
+ CMBlockBufferRef block_buffer;
CGSize image_buffer_size;
AVStream* stream = avformat_new_stream(s, NULL);
@@ -558,14 +581,22 @@ static int get_video_config(AVFormatContext *s)
avpriv_set_pts_info(stream, 64, 1, avf_time_base);
- image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
- image_buffer_size = CVImageBufferGetEncodedSize(image_buffer);
+ image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
+ block_buffer = CMSampleBufferGetDataBuffer(ctx->current_frame);
- stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
- stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- stream->codecpar->width = (int)image_buffer_size.width;
- stream->codecpar->height = (int)image_buffer_size.height;
- stream->codecpar->format = ctx->pixel_format;
+ if (image_buffer) {
+ image_buffer_size = CVImageBufferGetEncodedSize(image_buffer);
+
+ stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
+ stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ stream->codecpar->width = (int)image_buffer_size.width;
+ stream->codecpar->height = (int)image_buffer_size.height;
+ stream->codecpar->format = ctx->pixel_format;
+ } else {
+ stream->codecpar->codec_id = AV_CODEC_ID_DVVIDEO;
+ stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ stream->codecpar->format = ctx->pixel_format;
+ }
CFRelease(ctx->current_frame);
ctx->current_frame = nil;
@@ -670,8 +701,9 @@ static int avf_read_header(AVFormatContext *s)
AVCaptureDevice *audio_device = nil;
// Find capture device
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
- ctx->num_video_devices = [devices count];
+ NSArray *devices_muxed = [AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed];
+ ctx->num_video_devices = [devices count] + [devices_muxed count];
ctx->first_pts = av_gettime();
ctx->first_audio_pts = av_gettime();
@@ -690,14 +722,18 @@ static int avf_read_header(AVFormatContext *s)
const char *name = [[device localizedName] UTF8String];
index = [devices indexOfObject:device];
av_log(ctx, AV_LOG_INFO, "[%d] %s\n", index, name);
- index++;
+ }
+ for (AVCaptureDevice *device in devices_muxed) {
+ const char *name = [[device localizedName] UTF8String];
+ index = [devices count] + [devices_muxed indexOfObject:device];
+ av_log(ctx, AV_LOG_INFO, "[%d] %s\n", index, name);
}
#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
if (num_screens > 0) {
CGDirectDisplayID screens[num_screens];
CGGetActiveDisplayList(num_screens, screens, &num_screens);
for (int i = 0; i < num_screens; i++) {
- av_log(ctx, AV_LOG_INFO, "[%d] Capture screen %d\n", index + i, i);
+ av_log(ctx, AV_LOG_INFO, "[%d] Capture screen %d\n", ctx->num_video_devices + i, i);
}
}
#endif
@@ -725,7 +761,12 @@ static int avf_read_header(AVFormatContext *s)
if (ctx->video_device_index >= 0) {
if (ctx->video_device_index < ctx->num_video_devices) {
- video_device = [devices objectAtIndex:ctx->video_device_index];
+ if (ctx->video_device_index < [devices count]) {
+ video_device = [devices objectAtIndex:ctx->video_device_index];
+ } else {
+ video_device = [devices_muxed objectAtIndex:(ctx->video_device_index - [devices count])];
+ ctx->video_is_muxed = 1;
+ }
} else if (ctx->video_device_index < ctx->num_video_devices + num_screens) {
#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
CGDirectDisplayID screens[num_screens];
@@ -769,6 +810,14 @@ static int avf_read_header(AVFormatContext *s)
break;
}
}
+ // looking for muxed inputs
+ for (AVCaptureDevice *device in devices_muxed) {
+ if (!strncmp(ctx->video_filename, [[device localizedName] UTF8String], strlen(ctx->video_filename))) {
+ video_device = device;
+ ctx->video_is_muxed = 1;
+ break;
+ }
+ }
#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
// looking for screen inputs
@@ -909,7 +958,7 @@ static int copy_cvpixelbuffer(AVFormatContext *s,
status = CVPixelBufferLockBaseAddress(image_buffer, 0);
if (status != kCVReturnSuccess) {
- av_log(s, AV_LOG_ERROR, "Could not lock base address: %d\n", status);
+ av_log(s, AV_LOG_ERROR, "Could not lock base address: %d (%dx%d)\n", status, width, height);
return AVERROR_EXTERNAL;
}
@@ -942,13 +991,25 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt)
do {
CVImageBufferRef image_buffer;
+ CMBlockBufferRef block_buffer;
lock_frames(ctx);
- image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
-
if (ctx->current_frame != nil) {
int status;
- if (av_new_packet(pkt, (int)CVPixelBufferGetDataSize(image_buffer)) < 0) {
+ int length = 0;
+
+ image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
+ block_buffer = CMSampleBufferGetDataBuffer(ctx->current_frame);
+
+ if (image_buffer != nil) {
+ length = (int)CVPixelBufferGetDataSize(image_buffer);
+ } else if (block_buffer != nil) {
+ length = (int)CMBlockBufferGetDataLength(block_buffer);
+ } else {
+ return AVERROR(EINVAL);
+ }
+
+ if (av_new_packet(pkt, length) < 0) {
return AVERROR(EIO);
}
@@ -963,7 +1024,15 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = ctx->video_stream_index;
pkt->flags |= AV_PKT_FLAG_KEY;
- status = copy_cvpixelbuffer(s, image_buffer, pkt);
+ if (image_buffer) {
+ status = copy_cvpixelbuffer(s, image_buffer, pkt);
+ } else {
+ status = 0;
+ OSStatus ret = CMBlockBufferCopyDataBytes(block_buffer, 0, pkt->size, pkt->data);
+ if (ret != kCMBlockBufferNoErr) {
+ status = AVERROR(EIO);
+ }
+ }
CFRelease(ctx->current_frame);
ctx->current_frame = nil;
@@ -1057,16 +1126,15 @@ static int avf_close(AVFormatContext *s)
}
static const AVOption options[] = {
- { "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" },
+ { "list_devices", "list available devices", offsetof(AVFContext, list_devices), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ "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 },
{ "audio_device_index", "select audio device by index for devices with same name (starts at 0)", offsetof(AVFContext, audio_device_index), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "pixel_format", "set pixel format", offsetof(AVFContext, pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
{ "framerate", "set frame rate", offsetof(AVFContext, framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
{ "video_size", "set video size", offsetof(AVFContext, width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
- { "capture_cursor", "capture the screen cursor", offsetof(AVFContext, capture_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
- { "capture_mouse_clicks", "capture the screen mouse clicks", offsetof(AVFContext, capture_mouse_clicks), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "capture_cursor", "capture the screen cursor", offsetof(AVFContext, capture_cursor), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "capture_mouse_clicks", "capture the screen mouse clicks", offsetof(AVFContext, capture_mouse_clicks), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "capture_raw_data", "capture the raw data from device connection", offsetof(AVFContext, capture_raw_data), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_common.cpp b/chromium/third_party/ffmpeg/libavdevice/decklink_common.cpp
index c3a1d5588c4..659aa9be3f4 100644
--- a/chromium/third_party/ffmpeg/libavdevice/decklink_common.cpp
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_common.cpp
@@ -273,21 +273,15 @@ int ff_decklink_set_format(AVFormatContext *avctx,
#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
if (direction == DIRECTION_IN) {
if (ctx->dli->DoesSupportVideoMode(ctx->video_input, ctx->bmd_mode, (BMDPixelFormat) cctx->raw_format,
- bmdVideoInputFlagDefault,
+ bmdSupportedVideoModeDefault,
&support) != S_OK)
return -1;
} else {
BMDDisplayMode actualMode = ctx->bmd_mode;
- if (!ctx->supports_vanc || ctx->dlo->DoesSupportVideoMode(bmdVideoConnectionUnspecified, ctx->bmd_mode, ctx->raw_format,
- bmdVideoOutputVANC,
- &actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode) {
- /* Try without VANC enabled */
- if (ctx->dlo->DoesSupportVideoMode(bmdVideoConnectionUnspecified, ctx->bmd_mode, ctx->raw_format,
- bmdVideoOutputFlagDefault,
- &actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode) {
- return -1;
- }
- ctx->supports_vanc = 0;
+ if (ctx->dlo->DoesSupportVideoMode(bmdVideoConnectionUnspecified, ctx->bmd_mode, ctx->raw_format,
+ bmdSupportedVideoModeDefault,
+ &actualMode, &support) != S_OK || !support || ctx->bmd_mode != actualMode) {
+ return -1;
}
}
diff --git a/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp
index 8b621d00543..04b06aee3ab 100644
--- a/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp
+++ b/chromium/third_party/ffmpeg/libavdevice/decklink_enc.cpp
@@ -197,8 +197,11 @@ static int decklink_setup_video(AVFormatContext *avctx, AVStream *st)
" Check available formats with -list_formats 1.\n");
return -1;
}
- if (ctx->dlo->EnableVideoOutput(ctx->bmd_mode,
- ctx->supports_vanc ? bmdVideoOutputVANC : bmdVideoOutputFlagDefault) != S_OK) {
+ if (ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputVANC) != S_OK) {
+ av_log(avctx, AV_LOG_WARNING, "Could not enable video output with VANC! Trying without...\n");
+ ctx->supports_vanc = 0;
+ }
+ if (!ctx->supports_vanc && ctx->dlo->EnableVideoOutput(ctx->bmd_mode, bmdVideoOutputFlagDefault) != S_OK) {
av_log(avctx, AV_LOG_ERROR, "Could not enable video output!\n");
return -1;
}
diff --git a/chromium/third_party/ffmpeg/libavdevice/gdigrab.c b/chromium/third_party/ffmpeg/libavdevice/gdigrab.c
index b226bd08314..f4444406fa6 100644
--- a/chromium/third_party/ffmpeg/libavdevice/gdigrab.c
+++ b/chromium/third_party/ffmpeg/libavdevice/gdigrab.c
@@ -647,6 +647,7 @@ static const AVClass gdigrab_class = {
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
+ .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
/** gdi grabber device demuxer declaration */
diff --git a/chromium/third_party/ffmpeg/libavfilter/Makefile b/chromium/third_party/ffmpeg/libavfilter/Makefile
index bcc4ed85d65..455c809b151 100644
--- a/chromium/third_party/ffmpeg/libavfilter/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/Makefile
@@ -80,7 +80,9 @@ OBJS-$(CONFIG_ASETRATE_FILTER) += af_asetrate.o
OBJS-$(CONFIG_ASETTB_FILTER) += settb.o
OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o
OBJS-$(CONFIG_ASIDEDATA_FILTER) += f_sidedata.o
+OBJS-$(CONFIG_ASOFTCLIP_FILTER) += af_asoftclip.o
OBJS-$(CONFIG_ASPLIT_FILTER) += split.o
+OBJS-$(CONFIG_ASR_FILTER) += af_asr.o
OBJS-$(CONFIG_ASTATS_FILTER) += af_astats.o
OBJS-$(CONFIG_ASTREAMSELECT_FILTER) += f_streamselect.o framesync.o
OBJS-$(CONFIG_ATEMPO_FILTER) += af_atempo.o
@@ -99,6 +101,7 @@ OBJS-$(CONFIG_COMPENSATIONDELAY_FILTER) += af_compensationdelay.o
OBJS-$(CONFIG_CROSSFEED_FILTER) += af_crossfeed.o
OBJS-$(CONFIG_CRYSTALIZER_FILTER) += af_crystalizer.o
OBJS-$(CONFIG_DCSHIFT_FILTER) += af_dcshift.o
+OBJS-$(CONFIG_DEESSER_FILTER) += af_deesser.o
OBJS-$(CONFIG_DRMETER_FILTER) += af_drmeter.o
OBJS-$(CONFIG_DYNAUDNORM_FILTER) += af_dynaudnorm.o
OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o
@@ -178,6 +181,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o
OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o
OBJS-$(CONFIG_COLORKEY_OPENCL_FILTER) += vf_colorkey_opencl.o opencl.o \
opencl/colorkey.o
+OBJS-$(CONFIG_COLORHOLD_FILTER) += vf_colorkey.o
OBJS-$(CONFIG_COLORLEVELS_FILTER) += vf_colorlevels.o
OBJS-$(CONFIG_COLORMATRIX_FILTER) += vf_colormatrix.o
OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspace.o colorspacedsp.o
@@ -197,6 +201,7 @@ OBJS-$(CONFIG_DCTDNOIZ_FILTER) += vf_dctdnoiz.o
OBJS-$(CONFIG_DEBAND_FILTER) += vf_deband.o
OBJS-$(CONFIG_DEBLOCK_FILTER) += vf_deblock.o
OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o
+OBJS-$(CONFIG_DERAIN_FILTER) += vf_derain.o
OBJS-$(CONFIG_DECONVOLVE_FILTER) += vf_convolve.o framesync.o
OBJS-$(CONFIG_DEDOT_FILTER) += vf_dedot.o
OBJS-$(CONFIG_DEFLATE_FILTER) += vf_neighbor.o
@@ -294,6 +299,7 @@ OBJS-$(CONFIG_MIX_FILTER) += vf_mix.o
OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o
OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o
OBJS-$(CONFIG_NLMEANS_FILTER) += vf_nlmeans.o
+OBJS-$(CONFIG_NLMEANS_OPENCL_FILTER) += vf_nlmeans_opencl.o opencl.o opencl/nlmeans.o
OBJS-$(CONFIG_NNEDI_FILTER) += vf_nnedi.o
OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o
OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o
@@ -419,6 +425,7 @@ OBJS-$(CONFIG_W3FDIF_FILTER) += vf_w3fdif.o
OBJS-$(CONFIG_WAVEFORM_FILTER) += vf_waveform.o
OBJS-$(CONFIG_WEAVE_FILTER) += vf_weave.o
OBJS-$(CONFIG_XBR_FILTER) += vf_xbr.o
+OBJS-$(CONFIG_XMEDIAN_FILTER) += vf_xmedian.o framesync.o
OBJS-$(CONFIG_XSTACK_FILTER) += vf_stack.o framesync.o
OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o yadif_common.o
OBJS-$(CONFIG_YADIF_CUDA_FILTER) += vf_yadif_cuda.o vf_yadif_cuda.ptx.o \
@@ -460,6 +467,7 @@ OBJS-$(CONFIG_AVECTORSCOPE_FILTER) += avf_avectorscope.o
OBJS-$(CONFIG_CONCAT_FILTER) += avf_concat.o
OBJS-$(CONFIG_SHOWCQT_FILTER) += avf_showcqt.o lswsutils.o lavfutils.o
OBJS-$(CONFIG_SHOWFREQS_FILTER) += avf_showfreqs.o
+OBJS-$(CONFIG_SHOWSPATIAL_FILTER) += avf_showspatial.o
OBJS-$(CONFIG_SHOWSPECTRUM_FILTER) += avf_showspectrum.o
OBJS-$(CONFIG_SHOWSPECTRUMPIC_FILTER) += avf_showspectrum.o
OBJS-$(CONFIG_SHOWVOLUME_FILTER) += avf_showvolume.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_adeclick.c b/chromium/third_party/ffmpeg/libavfilter/af_adeclick.c
index bf0b7cb4080..50eef749218 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_adeclick.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_adeclick.c
@@ -22,7 +22,9 @@
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
+#include "filters.h"
#include "formats.h"
+#include "internal.h"
typedef struct DeclickChannel {
double *auxiliary;
@@ -73,6 +75,7 @@ typedef struct AudioDeclickContext {
uint64_t nb_samples;
uint64_t detected_errors;
int samples_left;
+ int eof;
AVAudioFifo *fifo;
double *window_func_lut;
@@ -544,68 +547,57 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
return 0;
}
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+static int filter_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
AudioDeclickContext *s = ctx->priv;
AVFrame *out = NULL;
- int ret = 0;
+ int ret = 0, j, ch, detected_errors = 0;
+ ThreadData td;
- if (s->pts == AV_NOPTS_VALUE)
- s->pts = in->pts;
-
- ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
- in->nb_samples);
- av_frame_free(&in);
-
- while (av_audio_fifo_size(s->fifo) >= s->window_size) {
- int j, ch, detected_errors = 0;
- ThreadData td;
-
- out = ff_get_audio_buffer(outlink, s->hop_size);
- if (!out)
- return AVERROR(ENOMEM);
+ out = ff_get_audio_buffer(outlink, s->hop_size);
+ if (!out)
+ return AVERROR(ENOMEM);
- ret = av_audio_fifo_peek(s->fifo, (void **)s->in->extended_data,
- s->window_size);
- if (ret < 0)
- break;
+ ret = av_audio_fifo_peek(s->fifo, (void **)s->in->extended_data,
+ s->window_size);
+ if (ret < 0)
+ goto fail;
- td.out = out;
- ret = ctx->internal->execute(ctx, filter_channel, &td, NULL, inlink->channels);
- if (ret < 0)
- goto fail;
+ td.out = out;
+ ret = ctx->internal->execute(ctx, filter_channel, &td, NULL, inlink->channels);
+ if (ret < 0)
+ goto fail;
- for (ch = 0; ch < s->in->channels; ch++) {
- double *is = (double *)s->is->extended_data[ch];
+ for (ch = 0; ch < s->in->channels; ch++) {
+ double *is = (double *)s->is->extended_data[ch];
- for (j = 0; j < s->hop_size; j++) {
- if (is[j])
- detected_errors++;
- }
+ for (j = 0; j < s->hop_size; j++) {
+ if (is[j])
+ detected_errors++;
}
+ }
- av_audio_fifo_drain(s->fifo, s->hop_size);
+ av_audio_fifo_drain(s->fifo, s->hop_size);
- if (s->samples_left > 0)
- out->nb_samples = FFMIN(s->hop_size, s->samples_left);
+ if (s->samples_left > 0)
+ out->nb_samples = FFMIN(s->hop_size, s->samples_left);
- out->pts = s->pts;
- s->pts += s->hop_size;
+ out->pts = s->pts;
+ s->pts += s->hop_size;
- s->detected_errors += detected_errors;
- s->nb_samples += out->nb_samples * inlink->channels;
+ s->detected_errors += detected_errors;
+ s->nb_samples += out->nb_samples * inlink->channels;
- ret = ff_filter_frame(outlink, out);
- if (ret < 0)
- break;
+ ret = ff_filter_frame(outlink, out);
+ if (ret < 0)
+ goto fail;
- if (s->samples_left > 0) {
- s->samples_left -= s->hop_size;
- if (s->samples_left <= 0)
- av_audio_fifo_drain(s->fifo, av_audio_fifo_size(s->fifo));
- }
+ if (s->samples_left > 0) {
+ s->samples_left -= s->hop_size;
+ if (s->samples_left <= 0)
+ av_audio_fifo_drain(s->fifo, av_audio_fifo_size(s->fifo));
}
fail:
@@ -614,27 +606,58 @@ fail:
return ret;
}
-static int request_frame(AVFilterLink *outlink)
+static int activate(AVFilterContext *ctx)
{
- AVFilterContext *ctx = outlink->src;
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
AudioDeclickContext *s = ctx->priv;
- int ret = 0;
+ AVFrame *in;
+ int ret, status;
+ int64_t pts;
- ret = ff_request_frame(ctx->inputs[0]);
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- if (ret == AVERROR_EOF && av_audio_fifo_size(s->fifo) > 0) {
- if (!s->samples_left)
- s->samples_left = av_audio_fifo_size(s->fifo) - s->overlap_skip;
+ ret = ff_inlink_consume_samples(inlink, s->window_size, s->window_size, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ if (s->pts == AV_NOPTS_VALUE)
+ s->pts = in->pts;
+
+ ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
+ in->nb_samples);
+ av_frame_free(&in);
+ if (ret < 0)
+ return ret;
+ }
+
+ if (av_audio_fifo_size(s->fifo) >= s->window_size ||
+ s->samples_left > 0)
+ return filter_frame(inlink);
- if (s->samples_left > 0) {
- AVFrame *in = ff_get_audio_buffer(outlink, s->window_size - s->samples_left);
- if (!in)
- return AVERROR(ENOMEM);
- ret = filter_frame(ctx->inputs[0], in);
+ if (av_audio_fifo_size(s->fifo) >= s->window_size) {
+ ff_filter_set_ready(ctx, 100);
+ return 0;
+ }
+
+ if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF) {
+ s->eof = 1;
+ s->samples_left = av_audio_fifo_size(s->fifo) - s->overlap_skip;
+ ff_filter_set_ready(ctx, 100);
+ return 0;
}
}
- return ret;
+ if (s->eof && s->samples_left <= 0) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+ return 0;
+ }
+
+ if (!s->eof)
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
}
static av_cold int init(AVFilterContext *ctx)
@@ -697,7 +720,6 @@ static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
@@ -707,7 +729,6 @@ static const AVFilterPad outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -719,6 +740,7 @@ AVFilter ff_af_adeclick = {
.priv_size = sizeof(AudioDeclickContext),
.priv_class = &adeclick_class,
.init = init,
+ .activate = activate,
.uninit = uninit,
.inputs = inputs,
.outputs = outputs,
@@ -746,6 +768,7 @@ AVFilter ff_af_adeclip = {
.priv_size = sizeof(AudioDeclickContext),
.priv_class = &adeclip_class,
.init = init,
+ .activate = activate,
.uninit = uninit,
.inputs = inputs,
.outputs = outputs,
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_afftfilt.c b/chromium/third_party/ffmpeg/libavfilter/af_afftfilt.c
index 8518f08dc5e..86278ef35b9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_afftfilt.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_afftfilt.c
@@ -26,12 +26,14 @@
#include "libavcodec/avfft.h"
#include "libavutil/eval.h"
#include "audio.h"
+#include "filters.h"
#include "window_func.h"
typedef struct AFFTFiltContext {
const AVClass *class;
char *real_str;
char *img_str;
+ int fft_size;
int fft_bits;
FFTContext *fft, *ifft;
@@ -46,9 +48,8 @@ typedef struct AFFTFiltContext {
int hop_size;
float overlap;
AVFrame *buffer;
- int start, end;
+ int eof;
int win_func;
- float win_scale;
float *window_func_lut;
} AFFTFiltContext;
@@ -61,21 +62,7 @@ enum { VAR_SAMPLE_RATE, VAR_BIN, VAR_NBBINS, V
static const AVOption afftfilt_options[] = {
{ "real", "set channels real expressions", OFFSET(real_str), AV_OPT_TYPE_STRING, {.str = "re" }, 0, 0, A },
{ "imag", "set channels imaginary expressions", OFFSET(img_str), AV_OPT_TYPE_STRING, {.str = "im" }, 0, 0, A },
- { "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, {.i64=12}, 4, 17, A, "fft" },
- { "w16", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, A, "fft" },
- { "w32", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, A, "fft" },
- { "w64", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, A, "fft" },
- { "w128", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, A, "fft" },
- { "w256", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, A, "fft" },
- { "w512", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, A, "fft" },
- { "w1024", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, A, "fft" },
- { "w2048", 0, 0, AV_OPT_TYPE_CONST, {.i64=11}, 0, 0, A, "fft" },
- { "w4096", 0, 0, AV_OPT_TYPE_CONST, {.i64=12}, 0, 0, A, "fft" },
- { "w8192", 0, 0, AV_OPT_TYPE_CONST, {.i64=13}, 0, 0, A, "fft" },
- { "w16384", 0, 0, AV_OPT_TYPE_CONST, {.i64=14}, 0, 0, A, "fft" },
- { "w32768", 0, 0, AV_OPT_TYPE_CONST, {.i64=15}, 0, 0, A, "fft" },
- { "w65536", 0, 0, AV_OPT_TYPE_CONST, {.i64=16}, 0, 0, A, "fft" },
- { "w131072",0, 0, AV_OPT_TYPE_CONST, {.i64=17}, 0, 0, A, "fft" },
+ { "win_size", "set window size", OFFSET(fft_size), AV_OPT_TYPE_INT, {.i64=4096}, 16, 131072, A },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, A, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, A, "win_func" },
{ "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, A, "win_func" },
@@ -137,12 +124,13 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
AFFTFiltContext *s = ctx->priv;
char *saveptr = NULL;
- int ret = 0, ch, i;
+ int ret = 0, ch;
float overlap;
char *args;
const char *last_expr = "1";
s->pts = AV_NOPTS_VALUE;
+ s->fft_bits = av_log2(s->fft_size);
s->fft = av_fft_init(s->fft_bits, 0);
s->ifft = av_fft_init(s->fft_bits, 1);
if (!s->fft || !s->ifft)
@@ -225,10 +213,6 @@ static int config_input(AVFilterLink *inlink)
if (s->overlap == 1)
s->overlap = overlap;
- for (s->win_scale = 0, i = 0; i < s->window_size; i++) {
- s->win_scale += s->window_func_lut[i] * s->window_func_lut[i];
- }
-
s->hop_size = s->window_size * (1 - s->overlap);
if (s->hop_size <= 0)
return AVERROR(EINVAL);
@@ -240,149 +224,172 @@ static int config_input(AVFilterLink *inlink)
return ret;
}
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
+static int filter_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
AFFTFiltContext *s = ctx->priv;
const int window_size = s->window_size;
- const float f = 1. / s->win_scale;
+ const float f = 1. / (s->window_size / 2);
double values[VAR_VARS_NB];
AVFrame *out, *in = NULL;
- int ch, n, ret, i, j, k;
- int start = s->start, end = s->end;
+ int ch, n, ret, i;
- if (s->pts == AV_NOPTS_VALUE)
- s->pts = frame->pts;
+ if (!in) {
+ in = ff_get_audio_buffer(outlink, window_size);
+ if (!in)
+ return AVERROR(ENOMEM);
+ }
- ret = av_audio_fifo_write(s->fifo, (void **)frame->extended_data, frame->nb_samples);
- av_frame_free(&frame);
+ ret = av_audio_fifo_peek(s->fifo, (void **)in->extended_data, window_size);
if (ret < 0)
- return ret;
+ goto fail;
+
+ for (ch = 0; ch < inlink->channels; ch++) {
+ const float *src = (float *)in->extended_data[ch];
+ FFTComplex *fft_data = s->fft_data[ch];
- while (av_audio_fifo_size(s->fifo) >= window_size) {
- if (!in) {
- in = ff_get_audio_buffer(outlink, window_size);
- if (!in)
- return AVERROR(ENOMEM);
+ for (n = 0; n < in->nb_samples; n++) {
+ fft_data[n].re = src[n] * s->window_func_lut[n];
+ fft_data[n].im = 0;
}
- ret = av_audio_fifo_peek(s->fifo, (void **)in->extended_data, window_size);
- if (ret < 0)
- break;
+ for (; n < window_size; n++) {
+ fft_data[n].re = 0;
+ fft_data[n].im = 0;
+ }
+ }
- for (ch = 0; ch < inlink->channels; ch++) {
- const float *src = (float *)in->extended_data[ch];
- FFTComplex *fft_data = s->fft_data[ch];
+ values[VAR_PTS] = s->pts;
+ values[VAR_SAMPLE_RATE] = inlink->sample_rate;
+ values[VAR_NBBINS] = window_size / 2;
+ values[VAR_CHANNELS] = inlink->channels;
- for (n = 0; n < in->nb_samples; n++) {
- fft_data[n].re = src[n] * s->window_func_lut[n];
- fft_data[n].im = 0;
- }
+ for (ch = 0; ch < inlink->channels; ch++) {
+ FFTComplex *fft_data = s->fft_data[ch];
- for (; n < window_size; n++) {
- fft_data[n].re = 0;
- fft_data[n].im = 0;
- }
- }
+ av_fft_permute(s->fft, fft_data);
+ av_fft_calc(s->fft, fft_data);
+ }
- values[VAR_PTS] = s->pts;
- values[VAR_SAMPLE_RATE] = inlink->sample_rate;
- values[VAR_NBBINS] = window_size / 2;
- values[VAR_CHANNELS] = inlink->channels;
+ for (ch = 0; ch < inlink->channels; ch++) {
+ FFTComplex *fft_data = s->fft_data[ch];
+ FFTComplex *fft_temp = s->fft_temp[ch];
+ float *buf = (float *)s->buffer->extended_data[ch];
+ int x;
+ values[VAR_CHANNEL] = ch;
- for (ch = 0; ch < inlink->channels; ch++) {
- FFTComplex *fft_data = s->fft_data[ch];
+ for (n = 0; n <= window_size / 2; n++) {
+ float fr, fi;
- av_fft_permute(s->fft, fft_data);
- av_fft_calc(s->fft, fft_data);
- }
+ values[VAR_BIN] = n;
+ values[VAR_REAL] = fft_data[n].re;
+ values[VAR_IMAG] = fft_data[n].im;
- for (ch = 0; ch < inlink->channels; ch++) {
- FFTComplex *fft_data = s->fft_data[ch];
- FFTComplex *fft_temp = s->fft_temp[ch];
- float *buf = (float *)s->buffer->extended_data[ch];
- int x;
- values[VAR_CHANNEL] = ch;
+ fr = av_expr_eval(s->real[ch], values, s);
+ fi = av_expr_eval(s->imag[ch], values, s);
- for (n = 0; n <= window_size / 2; n++) {
- float fr, fi;
+ fft_temp[n].re = fr;
+ fft_temp[n].im = fi;
+ }
- values[VAR_BIN] = n;
- values[VAR_REAL] = fft_data[n].re;
- values[VAR_IMAG] = fft_data[n].im;
+ for (n = window_size / 2 + 1, x = window_size / 2 - 1; n < window_size; n++, x--) {
+ fft_temp[n].re = fft_temp[x].re;
+ fft_temp[n].im = -fft_temp[x].im;
+ }
- fr = av_expr_eval(s->real[ch], values, s);
- fi = av_expr_eval(s->imag[ch], values, s);
+ av_fft_permute(s->ifft, fft_temp);
+ av_fft_calc(s->ifft, fft_temp);
- fft_temp[n].re = fr;
- fft_temp[n].im = fi;
- }
+ for (i = 0; i < window_size; i++) {
+ buf[i] += s->fft_temp[ch][i].re * f;
+ }
+ }
- for (n = window_size / 2 + 1, x = window_size / 2 - 1; n < window_size; n++, x--) {
- fft_temp[n].re = fft_temp[x].re;
- fft_temp[n].im = -fft_temp[x].im;
- }
+ out = ff_get_audio_buffer(outlink, s->hop_size);
+ if (!out) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
- av_fft_permute(s->ifft, fft_temp);
- av_fft_calc(s->ifft, fft_temp);
+ out->pts = s->pts;
+ s->pts += s->hop_size;
- start = s->start;
- end = s->end;
- k = end;
- for (i = 0, j = start; j < k && i < window_size; i++, j++) {
- buf[j] += s->fft_temp[ch][i].re * f;
- }
+ for (ch = 0; ch < inlink->channels; ch++) {
+ float *dst = (float *)out->extended_data[ch];
+ float *buf = (float *)s->buffer->extended_data[ch];
- for (; i < window_size; i++, j++) {
- buf[j] = s->fft_temp[ch][i].re * f;
- }
+ for (n = 0; n < s->hop_size; n++)
+ dst[n] = buf[n] * (1.f - s->overlap);
+ memmove(buf, buf + s->hop_size, window_size * 4);
+ }
- start += s->hop_size;
- end = j;
- }
+ ret = ff_filter_frame(outlink, out);
+ if (ret < 0)
+ goto fail;
- s->start = start;
- s->end = end;
+ av_audio_fifo_drain(s->fifo, s->hop_size);
- if (start >= window_size) {
- float *dst, *buf;
+fail:
+ av_frame_free(&in);
+ return ret < 0 ? ret : 0;
+}
- start -= window_size;
- end -= window_size;
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AFFTFiltContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret = 0, status;
+ int64_t pts;
- s->start = start;
- s->end = end;
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- out = ff_get_audio_buffer(outlink, window_size);
- if (!out) {
- ret = AVERROR(ENOMEM);
- break;
- }
+ if (!s->eof && av_audio_fifo_size(s->fifo) < s->window_size) {
+ ret = ff_inlink_consume_frame(inlink, &in);
+ if (ret < 0)
+ return ret;
- out->pts = s->pts;
- s->pts += window_size;
+ if (ret > 0) {
+ ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
+ in->nb_samples);
+ if (ret >= 0 && s->pts == AV_NOPTS_VALUE)
+ s->pts = in->pts;
- for (ch = 0; ch < inlink->channels; ch++) {
- dst = (float *)out->extended_data[ch];
- buf = (float *)s->buffer->extended_data[ch];
+ av_frame_free(&in);
+ if (ret < 0)
+ return ret;
+ }
+ }
- for (n = 0; n < window_size; n++) {
- dst[n] = buf[n] * (1 - s->overlap);
- }
- memmove(buf, buf + window_size, window_size * 4);
- }
+ if ((av_audio_fifo_size(s->fifo) >= s->window_size) ||
+ (av_audio_fifo_size(s->fifo) > 0 && s->eof)) {
+ ret = filter_frame(inlink);
+ if (av_audio_fifo_size(s->fifo) >= s->window_size)
+ ff_filter_set_ready(ctx, 100);
+ return ret;
+ }
- ret = ff_filter_frame(outlink, out);
- if (ret < 0)
- break;
+ if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF) {
+ s->eof = 1;
+ if (av_audio_fifo_size(s->fifo) >= 0) {
+ ff_filter_set_ready(ctx, 100);
+ return 0;
+ }
}
+ }
- av_audio_fifo_drain(s->fifo, s->hop_size);
+ if (s->eof && av_audio_fifo_size(s->fifo) <= 0) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+ return 0;
}
- av_frame_free(&in);
- return ret < 0 ? ret : 0;
+ if (!s->eof)
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
}
static int query_formats(AVFilterContext *ctx)
@@ -450,7 +457,6 @@ static const AVFilterPad inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -470,6 +476,7 @@ AVFilter ff_af_afftfilt = {
.priv_class = &afftfilt_class,
.inputs = inputs,
.outputs = outputs,
+ .activate = activate,
.query_formats = query_formats,
.uninit = uninit,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_aiir.c b/chromium/third_party/ffmpeg/libavfilter/af_aiir.c
index 20dea98cbbd..5a3b9e849d6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_aiir.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_aiir.c
@@ -57,6 +57,7 @@ typedef struct AudioIIRContext {
const AVClass *class;
char *a_str, *b_str, *g_str;
double dry_gain, wet_gain;
+ double mix;
int format;
int process;
int precision;
@@ -124,6 +125,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
AudioIIRContext *s = ctx->priv; \
const double ig = s->dry_gain; \
const double og = s->wet_gain; \
+ const double mix = s->mix; \
ThreadData *td = arg; \
AVFrame *in = td->in, *out = td->out; \
const type *src = (const type *)in->extended_data[ch]; \
@@ -152,6 +154,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
\
oc[0] = sample; \
sample *= og; \
+ sample = sample * mix + ic[0] * (1. - mix); \
if (need_clipping && sample < min) { \
(*clippings)++; \
dst[n] = min; \
@@ -177,6 +180,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
AudioIIRContext *s = ctx->priv; \
const double ig = s->dry_gain; \
const double og = s->wet_gain; \
+ const double mix = s->mix; \
ThreadData *td = arg; \
AVFrame *in = td->in, *out = td->out; \
const type *src = (const type *)in->extended_data[ch]; \
@@ -207,6 +211,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
o1 = o0; \
o0 *= og; \
\
+ o0 = o0 * mix + (1. - mix) * sample; \
if (need_clipping && o0 < min) { \
(*clippings)++; \
dst[n] = min; \
@@ -1074,6 +1079,7 @@ static const AVOption aiir_options[] = {
{ "flt", "single-precision floating-point", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, AF, "precision" },
{ "i32", "32-bit integers", 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, AF, "precision" },
{ "i16", "16-bit integers", 0, AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, AF, "precision" },
+ { "mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, AF },
{ "response", "show IR frequency response", OFFSET(response), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, VF },
{ "channel", "set IR channel to display frequency response", OFFSET(ir_channel), AV_OPT_TYPE_INT, {.i64=0}, 0, 1024, VF },
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "hd720"}, 0, 0, VF },
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_amultiply.c b/chromium/third_party/ffmpeg/libavfilter/af_amultiply.c
index b35eca72500..cc032846fab 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_amultiply.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_amultiply.c
@@ -34,7 +34,6 @@ typedef struct AudioMultiplyContext {
const AVClass *class;
AVFrame *frames[2];
- int64_t pts;
int planes;
int channels;
int samples_align;
@@ -95,21 +94,20 @@ static int activate(AVFilterContext *ctx)
}
}
- if (nb_samples > 0 && s->frames[0] && s->frames[1]) {
+ if (s->frames[0] && s->frames[1]) {
AVFrame *out;
int plane_samples;
if (av_sample_fmt_is_planar(ctx->inputs[0]->format))
- plane_samples = FFALIGN(nb_samples, s->samples_align);
+ plane_samples = FFALIGN(s->frames[0]->nb_samples, s->samples_align);
else
- plane_samples = FFALIGN(nb_samples * s->channels, s->samples_align);
+ plane_samples = FFALIGN(s->frames[0]->nb_samples * s->channels, s->samples_align);
- out = ff_get_audio_buffer(ctx->outputs[0], nb_samples);
+ out = ff_get_audio_buffer(ctx->outputs[0], s->frames[0]->nb_samples);
if (!out)
return AVERROR(ENOMEM);
- out->pts = s->pts;
- s->pts += nb_samples;
+ out->pts = s->frames[0]->pts;
if (av_get_packed_sample_fmt(ctx->inputs[0]->format) == AV_SAMPLE_FMT_FLT) {
for (i = 0; i < s->planes; i++) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_anlmdn.c b/chromium/third_party/ffmpeg/libavfilter/af_anlmdn.c
index 87c49c63b1c..b5bc94b4eb4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_anlmdn.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_anlmdn.c
@@ -22,6 +22,7 @@
#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
+#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
@@ -29,7 +30,6 @@
#include "af_anlmdndsp.h"
-#define MAX_DIFF 11.f
#define WEIGHT_LUT_NBITS 20
#define WEIGHT_LUT_SIZE (1<<WEIGHT_LUT_NBITS)
@@ -41,6 +41,7 @@ typedef struct AudioNLMeansContext {
float a;
int64_t pd;
int64_t rd;
+ float m;
int om;
float pdiff_lut_scale;
@@ -81,6 +82,7 @@ static const AVOption anlmdn_options[] = {
{ "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, AF, "mode" },
{ "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, AF, "mode" },
{ "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_MODE},0, 0, AF, "mode" },
+ { "m", "set smooth factor", OFFSET(m), AV_OPT_TYPE_FLOAT, {.dbl=11.}, 1, 15, AF },
{ NULL }
};
@@ -178,7 +180,7 @@ static int config_output(AVFilterLink *outlink)
if (ret < 0)
return ret;
- s->pdiff_lut_scale = 1.f / MAX_DIFF * WEIGHT_LUT_SIZE;
+ s->pdiff_lut_scale = 1.f / s->m * WEIGHT_LUT_SIZE;
for (int i = 0; i < WEIGHT_LUT_SIZE; i++) {
float w = -i / s->pdiff_lut_scale;
@@ -201,6 +203,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
float *cache = (float *)s->cache->extended_data[ch];
const float sw = (65536.f / (4 * K + 2)) / sqrtf(s->a);
float *dst = (float *)out->extended_data[ch] + s->offset;
+ const float smooth = s->m;
for (int i = S; i < s->H + S; i++) {
float P = 0.f, Q = 0.f;
@@ -222,9 +225,12 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
unsigned weight_lut_idx;
float w;
- av_assert2(distance >= 0.f);
+ if (distance < 0.f) {
+ cache[j] = 0.f;
+ continue;
+ }
w = distance * sw;
- if (w >= MAX_DIFF)
+ if (w >= smooth)
continue;
weight_lut_idx = w * s->pdiff_lut_scale;
av_assert2(weight_lut_idx < WEIGHT_LUT_SIZE);
@@ -312,7 +318,7 @@ static int request_frame(AVFilterLink *outlink)
if (s->eof_left < 0)
s->eof_left = av_audio_fifo_size(s->fifo) - (s->S + s->K);
- if (s->eof_left < 0)
+ if (s->eof_left <= 0)
return AVERROR_EOF;
in = ff_get_audio_buffer(outlink, s->H);
if (!in)
@@ -333,6 +339,29 @@ static av_cold void uninit(AVFilterContext *ctx)
av_frame_free(&s->cache);
}
+static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
+ char *res, int res_len, int flags)
+{
+ AudioNLMeansContext *s = ctx->priv;
+
+ if (!strcmp(cmd, "s")) {
+ float a;
+
+ if (av_sscanf(args, "%f", &a) == 1)
+ s->a = av_clipf(a, 0.00001, 10);
+ } else if (!strcmp(cmd, "o")) {
+ if (!strcmp(args, "i")) {
+ s->om = IN_MODE;
+ } else if (!strcmp(args, "o")) {
+ s->om = OUT_MODE;
+ } else if (!strcmp(args, "n")) {
+ s->om = NOISE_MODE;
+ }
+ }
+
+ return 0;
+}
+
static const AVFilterPad inputs[] = {
{
.name = "default",
@@ -361,6 +390,7 @@ AVFilter ff_af_anlmdn = {
.uninit = uninit,
.inputs = inputs,
.outputs = outputs,
+ .process_command = process_command,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c b/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
index a7e424f2416..bbc391a4ff2 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_asetnsamples.c
@@ -67,7 +67,7 @@ static int activate(AVFilterContext *ctx)
return ret;
if (ret > 0) {
- if ((!s->pad || (s->pad && frame->nb_samples == s->nb_out_samples))) {
+ if (!s->pad || frame->nb_samples == s->nb_out_samples) {
ret = ff_filter_frame(outlink, frame);
if (ff_inlink_queued_samples(inlink) >= s->nb_out_samples)
ff_filter_set_ready(ctx, 100);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_asoftclip.c b/chromium/third_party/ffmpeg/libavfilter/af_asoftclip.c
new file mode 100644
index 00000000000..a42b56dff4a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_asoftclip.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2019 The FFmpeg Project
+ *
+ * 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/opt.h"
+#include "avfilter.h"
+#include "audio.h"
+#include "formats.h"
+
+enum ASoftClipTypes {
+ ASC_TANH,
+ ASC_ATAN,
+ ASC_CUBIC,
+ ASC_EXP,
+ ASC_ALG,
+ ASC_QUINTIC,
+ ASC_SIN,
+ NB_TYPES,
+};
+
+typedef struct ASoftClipContext {
+ const AVClass *class;
+
+ int type;
+ double param;
+
+ void (*filter)(struct ASoftClipContext *s, void **dst, const void **src,
+ int nb_samples, int channels);
+} ASoftClipContext;
+
+#define OFFSET(x) offsetof(ASoftClipContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption asoftclip_options[] = {
+ { "type", "set softclip type", OFFSET(type), AV_OPT_TYPE_INT, {.i64=0}, 0, NB_TYPES-1, A, "types" },
+ { "tanh", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_TANH}, 0, 0, A, "types" },
+ { "atan", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ATAN}, 0, 0, A, "types" },
+ { "cubic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_CUBIC}, 0, 0, A, "types" },
+ { "exp", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_EXP}, 0, 0, A, "types" },
+ { "alg", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_ALG}, 0, 0, A, "types" },
+ { "quintic", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_QUINTIC},0, 0, A, "types" },
+ { "sin", NULL, 0, AV_OPT_TYPE_CONST, {.i64=ASC_SIN}, 0, 0, A, "types" },
+ { "param", "set softclip parameter", OFFSET(param), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0.01, 3, A },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(asoftclip);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layouts = NULL;
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP,
+ AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP,
+ AV_SAMPLE_FMT_NONE
+ };
+ int ret;
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
+
+ layouts = ff_all_channel_counts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+
+ ret = ff_set_common_channel_layouts(ctx, layouts);
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+#define SQR(x) ((x) * (x))
+
+static void filter_flt(ASoftClipContext *s,
+ void **dptr, const void **sptr,
+ int nb_samples, int channels)
+{
+ float param = s->param;
+
+ for (int c = 0; c < channels; c++) {
+ const float *src = sptr[c];
+ float *dst = dptr[c];
+
+ switch (s->type) {
+ case ASC_TANH:
+ for (int n = 0; n < nb_samples; n++) {
+ dst[n] = tanhf(src[n] * param);
+ }
+ break;
+ case ASC_ATAN:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = 2.f / M_PI * atanf(src[n] * param);
+ break;
+ case ASC_CUBIC:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= 1.5f)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = src[n] - 0.1481f * powf(src[n], 3.f);
+ }
+ break;
+ case ASC_EXP:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = 2.f / (1.f + expf(-2.f * src[n])) - 1.;
+ break;
+ case ASC_ALG:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = src[n] / (sqrtf(param + src[n] * src[n]));
+ break;
+ case ASC_QUINTIC:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= 1.25)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = src[n] - 0.08192f * powf(src[n], 5.f);
+ }
+ break;
+ case ASC_SIN:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= M_PI_2)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = sinf(src[n]);
+ }
+ break;
+ }
+ }
+}
+
+static void filter_dbl(ASoftClipContext *s,
+ void **dptr, const void **sptr,
+ int nb_samples, int channels)
+{
+ double param = s->param;
+
+ for (int c = 0; c < channels; c++) {
+ const double *src = sptr[c];
+ double *dst = dptr[c];
+
+ switch (s->type) {
+ case ASC_TANH:
+ for (int n = 0; n < nb_samples; n++) {
+ dst[n] = tanh(src[n] * param);
+ }
+ break;
+ case ASC_ATAN:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = 2. / M_PI * atan(src[n] * param);
+ break;
+ case ASC_CUBIC:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= 1.5)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = src[n] - 0.1481 * pow(src[n], 3.);
+ }
+ break;
+ case ASC_EXP:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = 2. / (1. + exp(-2. * src[n])) - 1.;
+ break;
+ case ASC_ALG:
+ for (int n = 0; n < nb_samples; n++)
+ dst[n] = src[n] / (sqrt(param + src[n] * src[n]));
+ break;
+ case ASC_QUINTIC:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= 1.25)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = src[n] - 0.08192 * pow(src[n], 5.);
+ }
+ break;
+ case ASC_SIN:
+ for (int n = 0; n < nb_samples; n++) {
+ if (FFABS(src[n]) >= M_PI_2)
+ dst[n] = FFSIGN(src[n]);
+ else
+ dst[n] = sin(src[n]);
+ }
+ break;
+ }
+ }
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ASoftClipContext *s = ctx->priv;
+
+ switch (inlink->format) {
+ case AV_SAMPLE_FMT_FLT:
+ case AV_SAMPLE_FMT_FLTP: s->filter = filter_flt; break;
+ case AV_SAMPLE_FMT_DBL:
+ case AV_SAMPLE_FMT_DBLP: s->filter = filter_dbl; break;
+ }
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ASoftClipContext *s = ctx->priv;
+ int nb_samples, channels;
+ AVFrame *out;
+
+ if (av_frame_is_writable(in)) {
+ out = in;
+ } else {
+ out = ff_get_audio_buffer(outlink, in->nb_samples);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+ }
+
+ if (av_sample_fmt_is_planar(in->format)) {
+ nb_samples = in->nb_samples;
+ channels = in->channels;
+ } else {
+ nb_samples = in->channels * in->nb_samples;
+ channels = 1;
+ }
+
+ s->filter(s, (void **)out->extended_data, (const void **)in->extended_data,
+ nb_samples, channels);
+
+ if (out != in)
+ av_frame_free(&in);
+
+ return ff_filter_frame(outlink, out);
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_asoftclip = {
+ .name = "asoftclip",
+ .description = NULL_IF_CONFIG_SMALL("Audio Soft Clipper."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(ASoftClipContext),
+ .priv_class = &asoftclip_class,
+ .inputs = inputs,
+ .outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_asr.c b/chromium/third_party/ffmpeg/libavfilter/af_asr.c
new file mode 100644
index 00000000000..0c08df13564
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_asr.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2019 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 <pocketsphinx/pocketsphinx.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+#include "audio.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct ASRContext {
+ const AVClass *class;
+
+ int rate;
+ char *hmm;
+ char *dict;
+ char *lm;
+ char *lmctl;
+ char *lmname;
+ char *logfn;
+
+ ps_decoder_t *ps;
+ cmd_ln_t *config;
+
+ int utt_started;
+} ASRContext;
+
+#define OFFSET(x) offsetof(ASRContext, x)
+#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
+static const AVOption asr_options[] = {
+ { "rate", "set sampling rate", OFFSET(rate), AV_OPT_TYPE_INT, {.i64=16000}, 0, INT_MAX, .flags = FLAGS },
+ { "hmm", "set directory containing acoustic model files", OFFSET(hmm), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
+ { "dict", "set pronunciation dictionary", OFFSET(dict), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
+ { "lm", "set language model file", OFFSET(lm), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
+ { "lmctl", "set language model set", OFFSET(lmctl), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
+ { "lmname","set which language model to use", OFFSET(lmname), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
+ { "logfn", "set output for log messages", OFFSET(logfn), AV_OPT_TYPE_STRING, {.str="/dev/null"}, .flags = FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(asr);
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVDictionary **metadata = &in->metadata;
+ ASRContext *s = ctx->priv;
+ int have_speech;
+ const char *speech;
+
+ ps_process_raw(s->ps, (const int16_t *)in->data[0], in->nb_samples, 0, 0);
+ have_speech = ps_get_in_speech(s->ps);
+ if (have_speech && !s->utt_started)
+ s->utt_started = 1;
+ if (!have_speech && s->utt_started) {
+ ps_end_utt(s->ps);
+ speech = ps_get_hyp(s->ps, NULL);
+ if (speech != NULL)
+ av_dict_set(metadata, "lavfi.asr.text", speech, 0);
+ ps_start_utt(s->ps);
+ s->utt_started = 0;
+ }
+
+ return ff_filter_frame(ctx->outputs[0], in);
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ ASRContext *s = ctx->priv;
+
+ ps_start_utt(s->ps);
+
+ return 0;
+}
+
+static av_cold int asr_init(AVFilterContext *ctx)
+{
+ ASRContext *s = ctx->priv;
+ const float frate = s->rate;
+ char *rate = av_asprintf("%f", frate);
+ const char *argv[] = { "-logfn", s->logfn,
+ "-hmm", s->hmm,
+ "-lm", s->lm,
+ "-lmctl", s->lmctl,
+ "-lmname", s->lmname,
+ "-dict", s->dict,
+ "-samprate", rate,
+ NULL };
+
+ s->config = cmd_ln_parse_r(NULL, ps_args(), 14, (char **)argv, 0);
+ av_free(rate);
+ if (!s->config)
+ return AVERROR(ENOMEM);
+
+ ps_default_search_args(s->config);
+ s->ps = ps_init(s->config);
+ if (!s->ps)
+ return AVERROR(ENOMEM);
+
+ return 0;
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ ASRContext *s = ctx->priv;
+ int sample_rates[] = { s->rate, -1 };
+ int ret;
+
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layout = NULL;
+
+ if ((ret = ff_add_format (&formats, AV_SAMPLE_FMT_S16 )) < 0 ||
+ (ret = ff_set_common_formats (ctx , formats )) < 0 ||
+ (ret = ff_add_channel_layout (&layout , AV_CH_LAYOUT_MONO )) < 0 ||
+ (ret = ff_set_common_channel_layouts (ctx , layout )) < 0 ||
+ (ret = ff_set_common_samplerates (ctx , ff_make_format_list(sample_rates) )) < 0)
+ return ret;
+
+ return 0;
+}
+
+static av_cold void asr_uninit(AVFilterContext *ctx)
+{
+ ASRContext *s = ctx->priv;
+
+ ps_free(s->ps);
+ s->ps = NULL;
+ cmd_ln_free_r(s->config);
+ s->config = NULL;
+}
+
+static const AVFilterPad asr_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad asr_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_asr = {
+ .name = "asr",
+ .description = NULL_IF_CONFIG_SMALL("Automatic Speech Recognition."),
+ .priv_size = sizeof(ASRContext),
+ .priv_class = &asr_class,
+ .init = asr_init,
+ .uninit = asr_uninit,
+ .query_formats = query_formats,
+ .inputs = asr_inputs,
+ .outputs = asr_outputs,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_astats.c b/chromium/third_party/ffmpeg/libavfilter/af_astats.c
index 92368793c27..7707f3158d8 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_astats.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_astats.c
@@ -20,6 +20,7 @@
*/
#include <float.h>
+#include <math.h>
#include "libavutil/opt.h"
#include "audio.h"
@@ -48,6 +49,9 @@
#define MEASURE_ZERO_CROSSINGS (1 << 16)
#define MEASURE_ZERO_CROSSINGS_RATE (1 << 17)
#define MEASURE_NUMBER_OF_SAMPLES (1 << 18)
+#define MEASURE_NUMBER_OF_NANS (1 << 19)
+#define MEASURE_NUMBER_OF_INFS (1 << 20)
+#define MEASURE_NUMBER_OF_DENORMALS (1 << 21)
#define MEASURE_MINMAXPEAK (MEASURE_MIN_LEVEL | MEASURE_MAX_LEVEL | MEASURE_PEAK_LEVEL)
@@ -68,6 +72,9 @@ typedef struct ChannelStats {
uint64_t min_count, max_count;
uint64_t zero_runs;
uint64_t nb_samples;
+ uint64_t nb_nans;
+ uint64_t nb_infs;
+ uint64_t nb_denormals;
} ChannelStats;
typedef struct AudioStatsContext {
@@ -83,6 +90,8 @@ typedef struct AudioStatsContext {
int maxbitdepth;
int measure_perchannel;
int measure_overall;
+ int is_float;
+ int is_double;
} AudioStatsContext;
#define OFFSET(x) offsetof(AudioStatsContext, x)
@@ -114,6 +123,9 @@ static const AVOption astats_options[] = {
{ "Zero_crossings" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ZERO_CROSSINGS }, 0, 0, FLAGS, "measure" },
{ "Zero_crossings_rate" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_ZERO_CROSSINGS_RATE }, 0, 0, FLAGS, "measure" },
{ "Number_of_samples" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_SAMPLES }, 0, 0, FLAGS, "measure" },
+ { "Number_of_NaNs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_NANS }, 0, 0, FLAGS, "measure" },
+ { "Number_of_Infs" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_INFS }, 0, 0, FLAGS, "measure" },
+ { "Number_of_denormals" , "", 0, AV_OPT_TYPE_CONST, {.i64=MEASURE_NUMBER_OF_DENORMALS }, 0, 0, FLAGS, "measure" },
{ "measure_overall", "only measure_perchannel these overall statistics", OFFSET(measure_overall), AV_OPT_TYPE_FLAGS, {.i64=MEASURE_ALL}, 0, UINT_MAX, FLAGS, "measure" },
{ NULL }
};
@@ -162,10 +174,10 @@ static void reset_stats(AudioStatsContext *s)
ChannelStats *p = &s->chstats[c];
p->min = p->nmin = p->min_sigma_x2 = DBL_MAX;
- p->max = p->nmax = p->max_sigma_x2 = DBL_MIN;
+ p->max = p->nmax = p->max_sigma_x2 =-DBL_MAX;
p->min_non_zero = DBL_MAX;
p->min_diff = DBL_MAX;
- p->max_diff = DBL_MIN;
+ p->max_diff = 0;
p->sigma_x = 0;
p->sigma_x2 = 0;
p->avg_sigma_x2 = 0;
@@ -181,6 +193,10 @@ static void reset_stats(AudioStatsContext *s)
p->max_count = 0;
p->zero_runs = 0;
p->nb_samples = 0;
+ p->nb_nans = 0;
+ p->nb_infs = 0;
+ p->nb_denormals = 0;
+ p->last = NAN;
}
}
@@ -196,6 +212,11 @@ static int config_output(AVFilterLink *outlink)
s->tc_samples = 5 * s->time_constant * outlink->sample_rate + .5;
s->nb_frames = 0;
s->maxbitdepth = av_get_bytes_per_sample(outlink->format) * 8;
+ s->is_double = outlink->format == AV_SAMPLE_FMT_DBL ||
+ outlink->format == AV_SAMPLE_FMT_DBLP;
+
+ s->is_float = outlink->format == AV_SAMPLE_FMT_FLT ||
+ outlink->format == AV_SAMPLE_FMT_FLTP;
reset_stats(s);
@@ -265,10 +286,12 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d,
p->sigma_x += nd;
p->sigma_x2 += nd * nd;
p->avg_sigma_x2 = p->avg_sigma_x2 * s->mult + (1.0 - s->mult) * nd * nd;
- p->min_diff = FFMIN(p->min_diff, fabs(d - p->last));
- p->max_diff = FFMAX(p->max_diff, fabs(d - p->last));
- p->diff1_sum += fabs(d - p->last);
- p->diff1_sum_x2 += (d - p->last) * (d - p->last);
+ if (!isnan(p->last)) {
+ p->min_diff = FFMIN(p->min_diff, fabs(d - p->last));
+ p->max_diff = FFMAX(p->max_diff, fabs(d - p->last));
+ p->diff1_sum += fabs(d - p->last);
+ p->diff1_sum_x2 += (d - p->last) * (d - p->last);
+ }
p->last = d;
p->mask |= i;
p->imask &= i;
@@ -280,6 +303,24 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d,
p->nb_samples++;
}
+static inline void update_float_stat(AudioStatsContext *s, ChannelStats *p, float d)
+{
+ int type = fpclassify(d);
+
+ p->nb_nans += type == FP_NAN;
+ p->nb_infs += type == FP_INFINITE;
+ p->nb_denormals += type == FP_SUBNORMAL;
+}
+
+static inline void update_double_stat(AudioStatsContext *s, ChannelStats *p, double d)
+{
+ int type = fpclassify(d);
+
+ p->nb_nans += type == FP_NAN;
+ p->nb_infs += type == FP_INFINITE;
+ p->nb_denormals += type == FP_SUBNORMAL;
+}
+
static void set_meta(AVDictionary **metadata, int chan, const char *key,
const char *fmt, double val)
{
@@ -299,16 +340,17 @@ static void set_meta(AVDictionary **metadata, int chan, const char *key,
static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
{
uint64_t mask = 0, imask = 0xFFFFFFFFFFFFFFFF, min_count = 0, max_count = 0, nb_samples = 0;
+ uint64_t nb_nans = 0, nb_infs = 0, nb_denormals = 0;
double min_runs = 0, max_runs = 0,
- min = DBL_MAX, max = DBL_MIN, min_diff = DBL_MAX, max_diff = 0,
- nmin = DBL_MAX, nmax = DBL_MIN,
+ min = DBL_MAX, max =-DBL_MAX, min_diff = DBL_MAX, max_diff = 0,
+ nmin = DBL_MAX, nmax =-DBL_MAX,
max_sigma_x = 0,
diff1_sum = 0,
diff1_sum_x2 = 0,
sigma_x = 0,
sigma_x2 = 0,
min_sigma_x2 = DBL_MAX,
- max_sigma_x2 = DBL_MIN;
+ max_sigma_x2 =-DBL_MAX;
AVRational depth;
int c;
@@ -337,6 +379,9 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
mask |= p->mask;
imask &= p->imask;
nb_samples += p->nb_samples;
+ nb_nans += p->nb_nans;
+ nb_infs += p->nb_infs;
+ nb_denormals += p->nb_denormals;
if (fabs(p->sigma_x) > fabs(max_sigma_x))
max_sigma_x = p->sigma_x;
@@ -379,6 +424,12 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
set_meta(metadata, c + 1, "Zero_crossings", "%f", p->zero_runs);
if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS_RATE)
set_meta(metadata, c + 1, "Zero_crossings_rate", "%f", p->zero_runs/(double)p->nb_samples);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_NANS)
+ set_meta(metadata, c + 1, "Number of NaNs", "%f", p->nb_nans);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_INFS)
+ set_meta(metadata, c + 1, "Number of Infs", "%f", p->nb_infs);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_DENORMALS)
+ set_meta(metadata, c + 1, "Number of denormals", "%f", p->nb_denormals);
}
if (s->measure_overall & MEASURE_DC_OFFSET)
@@ -414,33 +465,43 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata)
}
if (s->measure_overall & MEASURE_NUMBER_OF_SAMPLES)
set_meta(metadata, 0, "Overall.Number_of_samples", "%f", nb_samples / s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_NANS)
+ set_meta(metadata, 0, "Number of NaNs", "%f", nb_nans / (float)s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_INFS)
+ set_meta(metadata, 0, "Number of Infs", "%f", nb_infs / (float)s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_DENORMALS)
+ set_meta(metadata, 0, "Number of denormals", "%f", nb_denormals / (float)s->nb_channels);
}
-#define UPDATE_STATS_P(type, update_func, channel_func) \
+#define UPDATE_STATS_P(type, update_func, update_float, channel_func) \
for (int c = 0; c < channels; c++) { \
ChannelStats *p = &s->chstats[c]; \
const type *src = (const type *)data[c]; \
const type * const srcend = src + samples; \
- for (; src < srcend; src++) \
+ for (; src < srcend; src++) { \
update_func; \
+ update_float; \
+ } \
channel_func; \
}
-#define UPDATE_STATS_I(type, update_func, channel_func) \
+#define UPDATE_STATS_I(type, update_func, update_float, channel_func) \
for (int c = 0; c < channels; c++) { \
ChannelStats *p = &s->chstats[c]; \
const type *src = (const type *)data[0]; \
const type * const srcend = src + samples * channels; \
- for (src += c; src < srcend; src += channels) \
+ for (src += c; src < srcend; src += channels) { \
update_func; \
+ update_float; \
+ } \
channel_func; \
}
#define UPDATE_STATS(planar, type, sample, normalizer_suffix, int_sample) \
if ((s->measure_overall | s->measure_perchannel) & ~MEASURE_MINMAXPEAK) { \
- UPDATE_STATS_##planar(type, update_stat(s, p, sample, sample normalizer_suffix, int_sample), ); \
+ UPDATE_STATS_##planar(type, update_stat(s, p, sample, sample normalizer_suffix, int_sample), s->is_float ? update_float_stat(s, p, sample) : s->is_double ? update_double_stat(s, p, sample) : (void)NULL, ); \
} else { \
- UPDATE_STATS_##planar(type, update_minmax(s, p, sample), p->nmin = p->min normalizer_suffix; p->nmax = p->max normalizer_suffix;); \
+ UPDATE_STATS_##planar(type, update_minmax(s, p, sample), , p->nmin = p->min normalizer_suffix; p->nmax = p->max normalizer_suffix;); \
}
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
@@ -502,16 +563,17 @@ static void print_stats(AVFilterContext *ctx)
{
AudioStatsContext *s = ctx->priv;
uint64_t mask = 0, imask = 0xFFFFFFFFFFFFFFFF, min_count = 0, max_count = 0, nb_samples = 0;
+ uint64_t nb_nans = 0, nb_infs = 0, nb_denormals = 0;
double min_runs = 0, max_runs = 0,
- min = DBL_MAX, max = DBL_MIN, min_diff = DBL_MAX, max_diff = 0,
- nmin = DBL_MAX, nmax = DBL_MIN,
+ min = DBL_MAX, max =-DBL_MAX, min_diff = DBL_MAX, max_diff = 0,
+ nmin = DBL_MAX, nmax =-DBL_MAX,
max_sigma_x = 0,
diff1_sum_x2 = 0,
diff1_sum = 0,
sigma_x = 0,
sigma_x2 = 0,
min_sigma_x2 = DBL_MAX,
- max_sigma_x2 = DBL_MIN;
+ max_sigma_x2 =-DBL_MAX;
AVRational depth;
int c;
@@ -540,6 +602,9 @@ static void print_stats(AVFilterContext *ctx)
mask |= p->mask;
imask &= p->imask;
nb_samples += p->nb_samples;
+ nb_nans += p->nb_nans;
+ nb_infs += p->nb_infs;
+ nb_denormals += p->nb_denormals;
if (fabs(p->sigma_x) > fabs(max_sigma_x))
max_sigma_x = p->sigma_x;
@@ -583,6 +648,12 @@ static void print_stats(AVFilterContext *ctx)
av_log(ctx, AV_LOG_INFO, "Zero crossings: %"PRId64"\n", p->zero_runs);
if (s->measure_perchannel & MEASURE_ZERO_CROSSINGS_RATE)
av_log(ctx, AV_LOG_INFO, "Zero crossings rate: %f\n", p->zero_runs/(double)p->nb_samples);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_NANS)
+ av_log(ctx, AV_LOG_INFO, "Number of NaNs: %"PRId64"\n", p->nb_nans);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_INFS)
+ av_log(ctx, AV_LOG_INFO, "Number of Infs: %"PRId64"\n", p->nb_infs);
+ if ((s->is_float || s->is_double) && s->measure_perchannel & MEASURE_NUMBER_OF_DENORMALS)
+ av_log(ctx, AV_LOG_INFO, "Number of denormals: %"PRId64"\n", p->nb_denormals);
}
av_log(ctx, AV_LOG_INFO, "Overall\n");
@@ -619,6 +690,12 @@ static void print_stats(AVFilterContext *ctx)
}
if (s->measure_overall & MEASURE_NUMBER_OF_SAMPLES)
av_log(ctx, AV_LOG_INFO, "Number of samples: %"PRId64"\n", nb_samples / s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_NANS)
+ av_log(ctx, AV_LOG_INFO, "Number of NaNs: %f\n", nb_nans / (float)s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_INFS)
+ av_log(ctx, AV_LOG_INFO, "Number of Infs: %f\n", nb_infs / (float)s->nb_channels);
+ if ((s->is_float || s->is_double) && s->measure_overall & MEASURE_NUMBER_OF_DENORMALS)
+ av_log(ctx, AV_LOG_INFO, "Number of denormals: %f\n", nb_denormals / (float)s->nb_channels);
}
static av_cold void uninit(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_atempo.c b/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
index bfdad7d76bc..688dac5464e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_atempo.c
@@ -103,6 +103,9 @@ typedef struct ATempoContext {
// 1: output sample position
int64_t position[2];
+ // first input timestamp, all other timestamps are offset by this one
+ int64_t start_pts;
+
// sample format:
enum AVSampleFormat format;
@@ -186,6 +189,7 @@ static void yae_clear(ATempoContext *atempo)
atempo->nfrag = 0;
atempo->state = YAE_LOAD_FRAGMENT;
+ atempo->start_pts = AV_NOPTS_VALUE;
atempo->position[0] = 0;
atempo->position[1] = 0;
@@ -1068,7 +1072,7 @@ static int push_samples(ATempoContext *atempo,
atempo->dst_buffer->nb_samples = n_out;
// adjust the PTS:
- atempo->dst_buffer->pts =
+ atempo->dst_buffer->pts = atempo->start_pts +
av_rescale_q(atempo->nsamples_out,
(AVRational){ 1, outlink->sample_rate },
outlink->time_base);
@@ -1097,6 +1101,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)
const uint8_t *src = src_buffer->data[0];
const uint8_t *src_end = src + n_in * atempo->stride;
+ if (atempo->start_pts == AV_NOPTS_VALUE)
+ atempo->start_pts = av_rescale_q(src_buffer->pts,
+ inlink->time_base,
+ outlink->time_base);
+
while (src < src_end) {
if (!atempo->dst_buffer) {
atempo->dst_buffer = ff_get_audio_buffer(outlink, n_out);
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_biquads.c b/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
index 86cd10df3b3..247a47256fc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_biquads.c
@@ -110,6 +110,7 @@ typedef struct BiquadsContext {
double gain;
double frequency;
double width;
+ double mix;
uint64_t channels;
double a0, a1, a2;
@@ -120,7 +121,8 @@ typedef struct BiquadsContext {
void (*filter)(struct BiquadsContext *s, const void *ibuf, void *obuf, int len,
double *i1, double *i2, double *o1, double *o2,
- double b0, double b1, double b2, double a1, double a2, int *clippings);
+ double b0, double b1, double b2, double a1, double a2, int *clippings,
+ int disabled);
} BiquadsContext;
static av_cold int init(AVFilterContext *ctx)
@@ -177,7 +179,8 @@ static void biquad_## name (BiquadsContext *s, \
double *in1, double *in2, \
double *out1, double *out2, \
double b0, double b1, double b2, \
- double a1, double a2, int *clippings) \
+ double a1, double a2, int *clippings, \
+ int disabled) \
{ \
const type *ibuf = input; \
type *obuf = output; \
@@ -185,6 +188,9 @@ static void biquad_## name (BiquadsContext *s, \
double i2 = *in2; \
double o1 = *out1; \
double o2 = *out2; \
+ double wet = s->mix; \
+ double dry = 1. - wet; \
+ double out; \
int i; \
a1 = -a1; \
a2 = -a2; \
@@ -192,26 +198,32 @@ static void biquad_## name (BiquadsContext *s, \
for (i = 0; i+1 < len; i++) { \
o2 = i2 * b2 + i1 * b1 + ibuf[i] * b0 + o2 * a2 + o1 * a1; \
i2 = ibuf[i]; \
- if (need_clipping && o2 < min) { \
+ out = o2 * wet + i2 * dry; \
+ if (disabled) { \
+ obuf[i] = i2; \
+ } else if (need_clipping && out < min) { \
(*clippings)++; \
obuf[i] = min; \
- } else if (need_clipping && o2 > max) { \
+ } else if (need_clipping && out > max) { \
(*clippings)++; \
obuf[i] = max; \
} else { \
- obuf[i] = o2; \
+ obuf[i] = out; \
} \
i++; \
o1 = i1 * b2 + i2 * b1 + ibuf[i] * b0 + o1 * a2 + o2 * a1; \
i1 = ibuf[i]; \
- if (need_clipping && o1 < min) { \
+ out = o1 * wet + i1 * dry; \
+ if (disabled) { \
+ obuf[i] = i1; \
+ } else if (need_clipping && out < min) { \
(*clippings)++; \
obuf[i] = min; \
- } else if (need_clipping && o1 > max) { \
+ } else if (need_clipping && out > max) { \
(*clippings)++; \
obuf[i] = max; \
} else { \
- obuf[i] = o1; \
+ obuf[i] = out; \
} \
} \
if (i < len) { \
@@ -220,14 +232,17 @@ static void biquad_## name (BiquadsContext *s, \
i1 = ibuf[i]; \
o2 = o1; \
o1 = o0; \
- if (need_clipping && o0 < min) { \
+ out = o0 * wet + i1 * dry; \
+ if (disabled) { \
+ obuf[i] = i1; \
+ } else if (need_clipping && out < min) { \
(*clippings)++; \
obuf[i] = min; \
- } else if (need_clipping && o0 > max) { \
+ } else if (need_clipping && out > max) { \
(*clippings)++; \
obuf[i] = max; \
} else { \
- obuf[i] = o0; \
+ obuf[i] = out; \
} \
} \
*in1 = i1; \
@@ -442,7 +457,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_job
s->filter(s, buf->extended_data[ch], out_buf->extended_data[ch], buf->nb_samples,
&s->cache[ch].i1, &s->cache[ch].i2, &s->cache[ch].o1, &s->cache[ch].o2,
- s->b0, s->b1, s->b2, s->a1, s->a2, &s->cache[ch].clippings);
+ s->b0, s->b1, s->b2, s->a1, s->a2, &s->cache[ch].clippings, ctx->is_disabled);
}
return 0;
@@ -523,7 +538,16 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
return AVERROR(EINVAL);
}
- s->gain = gain;
+ s->gain = av_clipd(gain, -900, 900);
+ } else if (!strcmp(cmd, "mix") || !strcmp(cmd, "m")) {
+ double mix;
+
+ if (sscanf(args, "%lf", &mix) != 1) {
+ av_log(ctx, AV_LOG_ERROR, "Invalid mix value.\n");
+ return AVERROR(EINVAL);
+ }
+
+ s->mix = av_clipd(mix, 0, 1);
} else if ((!strcmp(cmd, "width") || !strcmp(cmd, "w")) &&
(s->filter_type == equalizer ||
s->filter_type == lowshelf ||
@@ -653,7 +677,7 @@ AVFilter ff_af_##name_ = { \
.outputs = outputs, \
.priv_class = &name_##_class, \
.process_command = process_command, \
- .flags = AVFILTER_FLAG_SLICE_THREADS, \
+ .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL, \
}
#if CONFIG_EQUALIZER_FILTER
@@ -671,6 +695,8 @@ static const AVOption equalizer_options[] = {
{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 99999, FLAGS},
{"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
{"g", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -693,6 +719,8 @@ static const AVOption bass_options[] = {
{"w", "set shelf transition steep", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
{"g", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -715,6 +743,8 @@ static const AVOption treble_options[] = {
{"w", "set shelf transition steep", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
{"g", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -736,6 +766,8 @@ static const AVOption bandpass_options[] = {
{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"csg", "use constant skirt gain", OFFSET(csg), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -756,6 +788,8 @@ static const AVOption bandreject_options[] = {
{"k", "kHz", 0, AV_OPT_TYPE_CONST, {.i64=KHERTZ}, 0, 0, FLAGS, "width_type"},
{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -778,6 +812,8 @@ static const AVOption lowpass_options[] = {
{"w", "set width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.707}, 0, 99999, FLAGS},
{"poles", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 1, 2, FLAGS},
{"p", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 1, 2, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -800,6 +836,8 @@ static const AVOption highpass_options[] = {
{"w", "set width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.707}, 0, 99999, FLAGS},
{"poles", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 1, 2, FLAGS},
{"p", "set number of poles", OFFSET(poles), AV_OPT_TYPE_INT, {.i64=2}, 1, 2, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -820,6 +858,8 @@ static const AVOption allpass_options[] = {
{"k", "kHz", 0, AV_OPT_TYPE_CONST, {.i64=KHERTZ}, 0, 0, FLAGS, "width_type"},
{"width", "set filter-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=707.1}, 0, 99999, FLAGS},
{"w", "set filter-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=707.1}, 0, 99999, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -842,6 +882,8 @@ static const AVOption lowshelf_options[] = {
{"w", "set shelf transition steep", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
{"g", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -864,6 +906,8 @@ static const AVOption highshelf_options[] = {
{"w", "set shelf transition steep", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0, 99999, FLAGS},
{"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
{"g", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 900, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
@@ -879,6 +923,8 @@ static const AVOption biquad_options[] = {
{"b0", NULL, OFFSET(b0), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, INT32_MAX, FLAGS},
{"b1", NULL, OFFSET(b1), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, INT32_MAX, FLAGS},
{"b2", NULL, OFFSET(b2), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, INT32_MAX, FLAGS},
+ {"mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
+ {"m", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, FLAGS},
{"channels", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{"c", "set channels to filter", OFFSET(channels), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
{NULL}
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_crossfeed.c b/chromium/third_party/ffmpeg/libavfilter/af_crossfeed.c
index beee67964dd..c819ca59a78 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_crossfeed.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_crossfeed.c
@@ -119,8 +119,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
s->o2 = s->o1;
s->o1 = oside;
- dst[0] = (mid + oside) * level_out;
- dst[1] = (mid - oside) * level_out;
+ if (ctx->is_disabled) {
+ dst[0] = src[0];
+ dst[1] = src[1];
+ } else {
+ dst[0] = (mid + oside) * level_out;
+ dst[1] = (mid - oside) * level_out;
+ }
}
if (out != in)
@@ -167,4 +172,5 @@ AVFilter ff_af_crossfeed = {
.priv_class = &crossfeed_class,
.inputs = inputs,
.outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_deesser.c b/chromium/third_party/ffmpeg/libavfilter/af_deesser.c
new file mode 100644
index 00000000000..fad3e98f5cf
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/af_deesser.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2018 Chris Johnson
+ *
+ * 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.
+ */
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "audio.h"
+#include "formats.h"
+
+typedef struct DeesserChannel {
+ double s1, s2, s3;
+ double m1, m2;
+ double ratioA, ratioB;
+ double iirSampleA, iirSampleB;
+ int flip;
+} DeesserChannel;
+
+typedef struct DeesserContext {
+ const AVClass *class;
+
+ double intensity;
+ double max;
+ double frequency;
+ int mode;
+
+ DeesserChannel *chan;
+} DeesserContext;
+
+enum OutModes {
+ IN_MODE,
+ OUT_MODE,
+ ESS_MODE,
+ NB_MODES
+};
+
+#define OFFSET(x) offsetof(DeesserContext, x)
+#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption deesser_options[] = {
+ { "i", "set intensity", OFFSET(intensity), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0.0, 1.0, A },
+ { "m", "set max deessing", OFFSET(max), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0.0, 1.0, A },
+ { "f", "set frequency", OFFSET(frequency), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 0.0, 1.0, A },
+ { "s", "set output mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=OUT_MODE}, 0, NB_MODES-1, A, "mode" },
+ { "i", "input", 0, AV_OPT_TYPE_CONST, {.i64=IN_MODE}, 0, 0, A, "mode" },
+ { "o", "output", 0, AV_OPT_TYPE_CONST, {.i64=OUT_MODE}, 0, 0, A, "mode" },
+ { "e", "ess", 0, AV_OPT_TYPE_CONST, {.i64=ESS_MODE}, 0, 0, A, "mode" },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(deesser);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layouts = NULL;
+ static const enum AVSampleFormat sample_fmts[] = {
+ AV_SAMPLE_FMT_DBLP,
+ AV_SAMPLE_FMT_NONE
+ };
+ int ret;
+
+ formats = ff_make_format_list(sample_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ ret = ff_set_common_formats(ctx, formats);
+ if (ret < 0)
+ return ret;
+
+ layouts = ff_all_channel_counts();
+ if (!layouts)
+ return AVERROR(ENOMEM);
+
+ ret = ff_set_common_channel_layouts(ctx, layouts);
+ if (ret < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ return ff_set_common_samplerates(ctx, formats);
+}
+
+static int config_input(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ DeesserContext *s = ctx->priv;
+
+ s->chan = av_calloc(inlink->channels, sizeof(*s->chan));
+ if (!s->chan)
+ return AVERROR(ENOMEM);
+
+ for (int i = 0; i < inlink->channels; i++) {
+ DeesserChannel *chan = &s->chan[i];
+
+ chan->ratioA = chan->ratioB = 1.0;
+ }
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ DeesserContext *s = ctx->priv;
+ AVFrame *out;
+
+ if (av_frame_is_writable(in)) {
+ out = in;
+ } else {
+ out = ff_get_audio_buffer(outlink, in->nb_samples);
+ if (!out) {
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+ av_frame_copy_props(out, in);
+ }
+
+ for (int ch = 0; ch < inlink->channels; ch++) {
+ DeesserChannel *dec = &s->chan[ch];
+ double *src = (double *)in->extended_data[ch];
+ double *dst = (double *)out->extended_data[ch];
+ double overallscale = inlink->sample_rate < 44100 ? 44100.0 / inlink->sample_rate : inlink->sample_rate / 44100.0;
+ double intensity = pow(s->intensity, 5) * (8192 / overallscale);
+ double maxdess = 1.0 / pow(10.0, ((s->max - 1.0) * 48.0) / 20);
+ double iirAmount = pow(s->frequency, 2) / overallscale;
+ double offset;
+ double sense;
+ double recovery;
+ double attackspeed;
+
+ for (int i = 0; i < in->nb_samples; i++) {
+ double sample = src[i];
+
+ dec->s3 = dec->s2;
+ dec->s2 = dec->s1;
+ dec->s1 = sample;
+ dec->m1 = (dec->s1 - dec->s2) * ((dec->s1 - dec->s2) / 1.3);
+ dec->m2 = (dec->s2 - dec->s3) * ((dec->s1 - dec->s2) / 1.3);
+ sense = (dec->m1 - dec->m2) * ((dec->m1 - dec->m2) / 1.3);
+ attackspeed = 7.0 + sense * 1024;
+
+ sense = 1.0 + intensity * intensity * sense;
+ sense = FFMIN(sense, intensity);
+ recovery = 1.0 + (0.01 / sense);
+
+ offset = 1.0 - fabs(sample);
+
+ if (dec->flip) {
+ dec->iirSampleA = (dec->iirSampleA * (1.0 - (offset * iirAmount))) +
+ (sample * (offset * iirAmount));
+ if (dec->ratioA < sense) {
+ dec->ratioA = ((dec->ratioA * attackspeed) + sense) / (attackspeed + 1.0);
+ } else {
+ dec->ratioA = 1.0 + ((dec->ratioA - 1.0) / recovery);
+ }
+
+ dec->ratioA = FFMIN(dec->ratioA, maxdess);
+ sample = dec->iirSampleA + ((sample - dec->iirSampleA) / dec->ratioA);
+ } else {
+ dec->iirSampleB = (dec->iirSampleB * (1.0 - (offset * iirAmount))) +
+ (sample * (offset * iirAmount));
+ if (dec->ratioB < sense) {
+ dec->ratioB = ((dec->ratioB * attackspeed) + sense) / (attackspeed + 1.0);
+ } else {
+ dec->ratioB = 1.0 + ((dec->ratioB - 1.0) / recovery);
+ }
+
+ dec->ratioB = FFMIN(dec->ratioB, maxdess);
+ sample = dec->iirSampleB + ((sample - dec->iirSampleB) / dec->ratioB);
+ }
+
+ dec->flip = !dec->flip;
+
+ if (ctx->is_disabled)
+ sample = src[i];
+
+ switch (s->mode) {
+ case IN_MODE: dst[i] = src[i]; break;
+ case OUT_MODE: dst[i] = sample; break;
+ case ESS_MODE: dst[i] = src[i] - sample; break;
+ }
+ }
+ }
+
+ if (out != in)
+ av_frame_free(&in);
+
+ return ff_filter_frame(outlink, out);
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ DeesserContext *s = ctx->priv;
+
+ av_freep(&s->chan);
+}
+
+static const AVFilterPad inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ .filter_frame = filter_frame,
+ .config_props = config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+AVFilter ff_af_deesser = {
+ .name = "deesser",
+ .description = NULL_IF_CONFIG_SMALL("Apply de-essing to the audio."),
+ .query_formats = query_formats,
+ .priv_size = sizeof(DeesserContext),
+ .priv_class = &deesser_class,
+ .uninit = uninit,
+ .inputs = inputs,
+ .outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c b/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c
index 59193042677..fd430884d77 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_dynaudnorm.c
@@ -34,6 +34,7 @@
#include "audio.h"
#include "avfilter.h"
+#include "filters.h"
#include "internal.h"
typedef struct cqueue {
@@ -67,10 +68,14 @@ typedef struct DynamicAudioNormalizerContext {
int channels;
int delay;
+ int eof;
+ int64_t pts;
cqueue **gain_history_original;
cqueue **gain_history_minimum;
cqueue **gain_history_smoothed;
+
+ cqueue *is_enabled;
} DynamicAudioNormalizerContext;
#define OFFSET(x) offsetof(DynamicAudioNormalizerContext, x)
@@ -279,6 +284,9 @@ static av_cold void uninit(AVFilterContext *ctx)
av_freep(&s->gain_history_minimum);
av_freep(&s->gain_history_smoothed);
+ cqueue_free(s->is_enabled);
+ s->is_enabled = NULL;
+
av_freep(&s->weights);
ff_bufqueue_discard_all(&s->queue);
@@ -292,10 +300,7 @@ static int config_input(AVFilterLink *inlink)
uninit(ctx);
- s->frame_len =
- inlink->min_samples =
- inlink->max_samples =
- inlink->partial_buf_size = frame_size(inlink->sample_rate, s->frame_len_msec);
+ s->frame_len = frame_size(inlink->sample_rate, s->frame_len_msec);
av_log(ctx, AV_LOG_DEBUG, "frame len %d\n", s->frame_len);
s->fade_factors[0] = av_malloc_array(s->frame_len, sizeof(*s->fade_factors[0]));
@@ -308,10 +313,11 @@ static int config_input(AVFilterLink *inlink)
s->gain_history_minimum = av_calloc(inlink->channels, sizeof(*s->gain_history_minimum));
s->gain_history_smoothed = av_calloc(inlink->channels, sizeof(*s->gain_history_smoothed));
s->weights = av_malloc_array(s->filter_size, sizeof(*s->weights));
+ s->is_enabled = cqueue_create(s->filter_size);
if (!s->prev_amplification_factor || !s->dc_correction_value ||
!s->compress_threshold || !s->fade_factors[0] || !s->fade_factors[1] ||
!s->gain_history_original || !s->gain_history_minimum ||
- !s->gain_history_smoothed || !s->weights)
+ !s->gain_history_smoothed || !s->is_enabled || !s->weights)
return AVERROR(ENOMEM);
for (c = 0; c < inlink->channels; c++) {
@@ -631,7 +637,7 @@ static void analyze_frame(DynamicAudioNormalizerContext *s, AVFrame *frame)
}
}
-static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *frame)
+static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *frame, int enabled)
{
int c, i;
@@ -641,7 +647,7 @@ static void amplify_frame(DynamicAudioNormalizerContext *s, AVFrame *frame)
cqueue_dequeue(s->gain_history_smoothed[c], &current_amplification_factor);
- for (i = 0; i < frame->nb_samples; i++) {
+ for (i = 0; i < frame->nb_samples && enabled; i++) {
const double amplification_factor = fade(s->prev_amplification_factor[c],
current_amplification_factor, i,
s->fade_factors);
@@ -661,15 +667,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterContext *ctx = inlink->dst;
DynamicAudioNormalizerContext *s = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
- int ret = 0;
+ int ret = 1;
if (!cqueue_empty(s->gain_history_smoothed[0])) {
+ double is_enabled;
AVFrame *out = ff_bufqueue_get(&s->queue);
- amplify_frame(s, out);
+ cqueue_dequeue(s->is_enabled, &is_enabled);
+
+ amplify_frame(s, out, is_enabled > 0.);
ret = ff_filter_frame(outlink, out);
}
+ av_frame_make_writable(in);
+ cqueue_enqueue(s->is_enabled, !ctx->is_disabled);
analyze_frame(s, in);
ff_bufqueue_add(ctx, &s->queue, in);
@@ -701,34 +712,76 @@ static int flush_buffer(DynamicAudioNormalizerContext *s, AVFilterLink *inlink,
return filter_frame(inlink, out);
}
-static int request_frame(AVFilterLink *outlink)
+static int flush(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
DynamicAudioNormalizerContext *s = ctx->priv;
int ret = 0;
- ret = ff_request_frame(ctx->inputs[0]);
+ if (!cqueue_empty(s->gain_history_smoothed[0])) {
+ ret = flush_buffer(s, ctx->inputs[0], outlink);
+ } else if (s->queue.available) {
+ AVFrame *out = ff_bufqueue_get(&s->queue);
+
+ s->pts = out->pts;
+ ret = ff_filter_frame(outlink, out);
+ s->delay = s->queue.available;
+ }
- if (ret == AVERROR_EOF && !ctx->is_disabled && s->delay) {
- if (!cqueue_empty(s->gain_history_smoothed[0])) {
- ret = flush_buffer(s, ctx->inputs[0], outlink);
- } else if (s->queue.available) {
- AVFrame *out = ff_bufqueue_get(&s->queue);
+ return ret;
+}
- ret = ff_filter_frame(outlink, out);
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ DynamicAudioNormalizerContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret = 0, status;
+ int64_t pts;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ if (!s->eof) {
+ ret = ff_inlink_consume_samples(inlink, s->frame_len, s->frame_len, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ ret = filter_frame(inlink, in);
+ if (ret <= 0)
+ return ret;
+ }
+
+ if (ff_inlink_queued_samples(inlink) >= s->frame_len) {
+ ff_filter_set_ready(ctx, 10);
+ return 0;
}
}
- return ret;
+ if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF)
+ s->eof = 1;
+ }
+
+ if (s->eof && s->delay > 0)
+ return flush(outlink);
+
+ if (s->eof && s->delay <= 0) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+ return 0;
+ }
+
+ if (!s->eof)
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
}
static const AVFilterPad avfilter_af_dynaudnorm_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
.config_props = config_input,
- .needs_writable = 1,
},
{ NULL }
};
@@ -737,7 +790,6 @@ static const AVFilterPad avfilter_af_dynaudnorm_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -749,7 +801,9 @@ AVFilter ff_af_dynaudnorm = {
.priv_size = sizeof(DynamicAudioNormalizerContext),
.init = init,
.uninit = uninit,
+ .activate = activate,
.inputs = avfilter_af_dynaudnorm_inputs,
.outputs = avfilter_af_dynaudnorm_outputs,
.priv_class = &dynaudnorm_class,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c b/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c
index 13c6f477767..83eba47410a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_extrastereo.c
@@ -128,4 +128,5 @@ AVFilter ff_af_extrastereo = {
.priv_class = &extrastereo_class,
.inputs = inputs,
.outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_rubberband.c b/chromium/third_party/ffmpeg/libavfilter/af_rubberband.c
index ea6f4ff2c9c..ef937f44157 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_rubberband.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_rubberband.c
@@ -24,6 +24,7 @@
#include "audio.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "internal.h"
@@ -36,7 +37,8 @@ typedef struct RubberBandContext {
smoothing, formant, opitch, channels;
int64_t nb_samples_out;
int64_t nb_samples_in;
- int flushed;
+ int64_t first_pts;
+ int nb_samples;
} RubberBandContext;
#define OFFSET(x) offsetof(RubberBandContext, x)
@@ -123,7 +125,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame *out;
int ret = 0, nb_samples;
- rubberband_process(s->rbs, (const float *const *)in->data, in->nb_samples, 0);
+ if (s->first_pts == AV_NOPTS_VALUE)
+ s->first_pts = in->pts;
+
+ rubberband_process(s->rbs, (const float *const *)in->data, in->nb_samples, ff_outlink_get_status(inlink));
s->nb_samples_in += in->nb_samples;
nb_samples = rubberband_available(s->rbs);
@@ -133,7 +138,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_free(&in);
return AVERROR(ENOMEM);
}
- out->pts = av_rescale_q(s->nb_samples_out,
+ out->pts = s->first_pts + av_rescale_q(s->nb_samples_out,
(AVRational){ 1, outlink->sample_rate },
outlink->time_base);
nb_samples = rubberband_retrieve(s->rbs, (float *const *)out->data, nb_samples);
@@ -143,7 +148,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
av_frame_free(&in);
- return ret;
+ return ret < 0 ? ret : nb_samples;
}
static int config_input(AVFilterLink *inlink)
@@ -157,54 +162,38 @@ static int config_input(AVFilterLink *inlink)
if (s->rbs)
rubberband_delete(s->rbs);
s->rbs = rubberband_new(inlink->sample_rate, inlink->channels, opts, 1. / s->tempo, s->pitch);
+ if (!s->rbs)
+ return AVERROR(ENOMEM);
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = rubberband_get_samples_required(s->rbs);
+ s->nb_samples = rubberband_get_samples_required(s->rbs);
+ s->first_pts = AV_NOPTS_VALUE;
return 0;
}
-static int request_frame(AVFilterLink *outlink)
+static int activate(AVFilterContext *ctx)
{
- AVFilterContext *ctx = outlink->src;
- RubberBandContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
- int ret = 0;
-
- ret = ff_request_frame(ctx->inputs[0]);
-
- if (ret == AVERROR_EOF && !s->flushed) {
- if (rubberband_available(s->rbs) > 0) {
- AVFrame *out = ff_get_audio_buffer(inlink, 1);
- int nb_samples;
-
- if (!out)
- return AVERROR(ENOMEM);
-
- rubberband_process(s->rbs, (const float *const *)out->data, 1, 1);
- av_frame_free(&out);
- nb_samples = rubberband_available(s->rbs);
-
- if (nb_samples > 0) {
- out = ff_get_audio_buffer(outlink, nb_samples);
- if (!out)
- return AVERROR(ENOMEM);
- out->pts = av_rescale_q(s->nb_samples_out,
- (AVRational){ 1, outlink->sample_rate },
- outlink->time_base);
- nb_samples = rubberband_retrieve(s->rbs, (float *const *)out->data, nb_samples);
- out->nb_samples = nb_samples;
- ret = ff_filter_frame(outlink, out);
- s->nb_samples_out += nb_samples;
- }
- }
- s->flushed = 1;
- av_log(ctx, AV_LOG_DEBUG, "nb_samples_in %"PRId64" nb_samples_out %"PRId64"\n",
- s->nb_samples_in, s->nb_samples_out);
+ AVFilterLink *outlink = ctx->outputs[0];
+ RubberBandContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ ret = filter_frame(inlink, in);
+ if (ret != 0)
+ return ret;
}
- return ret;
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
@@ -244,7 +233,6 @@ static const AVFilterPad rubberband_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -253,7 +241,6 @@ static const AVFilterPad rubberband_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -265,6 +252,7 @@ AVFilter ff_af_rubberband = {
.priv_size = sizeof(RubberBandContext),
.priv_class = &rubberband_class,
.uninit = uninit,
+ .activate = activate,
.inputs = rubberband_inputs,
.outputs = rubberband_outputs,
.process_command = process_command,
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c b/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
index 335f55bb4e9..7dd8c5a1d81 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_silenceremove.c
@@ -206,6 +206,7 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
SilenceRemoveContext *s = ctx->priv;
+ s->next_pts = AV_NOPTS_VALUE;
s->window_size = FFMAX((inlink->sample_rate * s->window_ratio), 1) * inlink->channels;
s->window = av_malloc_array(s->window_size, sizeof(*s->window));
if (!s->window)
@@ -328,6 +329,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
nb_samples_read = nb_samples_written = 0;
+ if (s->next_pts == AV_NOPTS_VALUE)
+ s->next_pts = in->pts;
+
switch (s->mode) {
case SILENCE_TRIM:
silence_trim:
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_sofalizer.c b/chromium/third_party/ffmpeg/libavfilter/af_sofalizer.c
index 109cf5695b3..ccf3872e77b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_sofalizer.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_sofalizer.c
@@ -35,6 +35,7 @@
#include "libavutil/intmath.h"
#include "libavutil/opt.h"
#include "avfilter.h"
+#include "filters.h"
#include "internal.h"
#include "audio.h"
@@ -81,6 +82,7 @@ typedef struct SOFAlizerContext {
int buffer_length; /* is: longest IR plus max. delay in all SOFA files */
/* then choose next power of 2 */
int n_fft; /* number of samples in one FFT block */
+ int nb_samples;
/* netCDF variables */
int *delay[2]; /* broadband delay for each channel/IR to be convolved */
@@ -603,6 +605,31 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, out);
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ SOFAlizerContext *s = ctx->priv;
+ AVFrame *in;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ if (s->nb_samples)
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ else
+ ret = ff_inlink_consume_frame(inlink, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static int query_formats(AVFilterContext *ctx)
{
struct SOFAlizerContext *s = ctx->priv;
@@ -964,11 +991,8 @@ static int config_input(AVFilterLink *inlink)
SOFAlizerContext *s = ctx->priv;
int ret;
- if (s->type == FREQUENCY_DOMAIN) {
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = s->framesize;
- }
+ if (s->type == FREQUENCY_DOMAIN)
+ s->nb_samples = s->framesize;
/* gain -3 dB per channel */
s->gain_lfe = expf((s->gain - 3 * inlink->channels + s->lfe_gain) / 20 * M_LN10);
@@ -1047,7 +1071,6 @@ static const AVFilterPad inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -1066,6 +1089,7 @@ AVFilter ff_af_sofalizer = {
.priv_size = sizeof(SOFAlizerContext),
.priv_class = &sofalizer_class,
.init = init,
+ .activate = activate,
.uninit = uninit,
.query_formats = query_formats,
.inputs = inputs,
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_stereowiden.c b/chromium/third_party/ffmpeg/libavfilter/af_stereowiden.c
index ef16fcec73b..d23c8dba754 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_stereowiden.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_stereowiden.c
@@ -113,8 +113,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->cur == s->buffer + s->length)
s->cur = s->buffer;
- dst[0] = drymix * left - crossfeed * right - feedback * s->cur[1];
- dst[1] = drymix * right - crossfeed * left - feedback * s->cur[0];
+ if (ctx->is_disabled) {
+ dst[0] = left;
+ dst[1] = right;
+ } else {
+ dst[0] = drymix * left - crossfeed * right - feedback * s->cur[1];
+ dst[1] = drymix * right - crossfeed * left - feedback * s->cur[0];
+ }
s->cur[0] = left;
s->cur[1] = right;
@@ -159,4 +164,5 @@ AVFilter ff_af_stereowiden = {
.uninit = uninit,
.inputs = inputs,
.outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_superequalizer.c b/chromium/third_party/ffmpeg/libavfilter/af_superequalizer.c
index f38cca5c8ba..f11ec9e6d12 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_superequalizer.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_superequalizer.c
@@ -25,6 +25,7 @@
#include "audio.h"
#include "avfilter.h"
+#include "filters.h"
#include "internal.h"
#define NBANDS 17
@@ -203,7 +204,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
dst = (float *)s->out->extended_data[ch];
src = (float *)in->extended_data[ch];
- for (i = 0; i < s->winlen; i++)
+ for (i = 0; i < in->nb_samples; i++)
fsamples[i] = src[i];
for (; i < s->tabsize; i++)
fsamples[i] = 0;
@@ -240,6 +241,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, out);
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ SuperEqualizerContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->winlen, s->winlen, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold int init(AVFilterContext *ctx)
{
SuperEqualizerContext *s = ctx->priv;
@@ -277,10 +300,6 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
SuperEqualizerContext *s = ctx->priv;
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = s->winlen;
-
s->out = ff_get_audio_buffer(inlink, s->tabsize);
if (!s->out)
return AVERROR(ENOMEM);
@@ -314,7 +333,6 @@ static const AVFilterPad superequalizer_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
@@ -363,6 +381,7 @@ AVFilter ff_af_superequalizer = {
.priv_class = &superequalizer_class,
.query_formats = query_formats,
.init = init,
+ .activate = activate,
.uninit = uninit,
.inputs = superequalizer_inputs,
.outputs = superequalizer_outputs,
diff --git a/chromium/third_party/ffmpeg/libavfilter/af_surround.c b/chromium/third_party/ffmpeg/libavfilter/af_surround.c
index 66d8e21471b..5a4eca77557 100644
--- a/chromium/third_party/ffmpeg/libavfilter/af_surround.c
+++ b/chromium/third_party/ffmpeg/libavfilter/af_surround.c
@@ -18,12 +18,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "avfilter.h"
#include "audio.h"
+#include "filters.h"
+#include "internal.h"
#include "formats.h"
#include "window_func.h"
@@ -37,9 +40,25 @@ typedef struct AudioSurroundContext {
float level_out;
float fc_in;
float fc_out;
+ float fl_in;
+ float fl_out;
+ float fr_in;
+ float fr_out;
+ float sl_in;
+ float sl_out;
+ float sr_in;
+ float sr_out;
+ float bl_in;
+ float bl_out;
+ float br_in;
+ float br_out;
+ float bc_in;
+ float bc_out;
float lfe_in;
float lfe_out;
int lfe_mode;
+ float angle;
+ int win_size;
int win_func;
float overlap;
@@ -89,6 +108,7 @@ typedef struct AudioSurroundContext {
float *window_func_lut;
int64_t pts;
+ int eof;
void (*filter)(AVFilterContext *ctx);
void (*upmix_stereo)(AVFilterContext *ctx,
@@ -198,6 +218,27 @@ static int config_input(AVFilterLink *inlink)
ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_CENTER);
if (ch >= 0)
s->input_levels[ch] *= s->fc_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_LEFT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->fl_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_FRONT_RIGHT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->fr_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_SIDE_LEFT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->sl_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_SIDE_RIGHT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->sr_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_LEFT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->bl_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_RIGHT);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->br_in;
+ ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_BACK_CENTER);
+ if (ch >= 0)
+ s->input_levels[ch] *= s->bc_in;
ch = av_get_channel_layout_channel_index(inlink->channel_layout, AV_CH_LOW_FREQUENCY);
if (ch >= 0)
s->input_levels[ch] *= s->lfe_in;
@@ -240,6 +281,27 @@ static int config_output(AVFilterLink *outlink)
ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_CENTER);
if (ch >= 0)
s->output_levels[ch] *= s->fc_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_LEFT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->fl_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_FRONT_RIGHT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->fr_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_SIDE_LEFT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->sl_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_SIDE_RIGHT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->sr_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_LEFT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->bl_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_RIGHT);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->br_out;
+ ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_BACK_CENTER);
+ if (ch >= 0)
+ s->output_levels[ch] *= s->bc_out;
ch = av_get_channel_layout_channel_index(outlink->channel_layout, AV_CH_LOW_FREQUENCY);
if (ch >= 0)
s->output_levels[ch] *= s->lfe_out;
@@ -252,9 +314,31 @@ static int config_output(AVFilterLink *outlink)
return 0;
}
+static void stereo_transform(float *x, float *y, float angle)
+{
+ float reference, r, a;
+
+ if (angle == 90.f)
+ return;
+
+ reference = angle * M_PI / 180.f;
+ r = hypotf(*x, *y);
+ a = atan2f(*x, *y);
+
+ if (fabsf(a) <= M_PI_4)
+ a *= reference / M_PI_2;
+ else
+ a = M_PI + 2 * (-2 * M_PI + reference) * (M_PI - fabsf(a)) * FFDIFFSIGN(a, 0) / (3 * M_PI);
+
+ *x = av_clipf(sinf(a) * r, -1, 1);
+ *y = av_clipf(cosf(a) * r, -1, 1);
+}
+
static void stereo_position(float a, float p, float *x, float *y)
{
- *x = av_clipf(a+FFMAX(0, sinf(p-M_PI_2))*FFDIFFSIGN(a,0), -1, 1);
+ av_assert2(a >= -1.f && a <= 1.f);
+ av_assert2(p >= 0.f && p <= M_PI);
+ *x = av_clipf(a+a*FFMAX(0, p*p-M_PI_2), -1, 1);
*y = av_clipf(cosf(a*M_PI_2+M_PI)*cosf(M_PI_2-p/M_PI)*M_LN10+1, -1, 1);
}
@@ -601,6 +685,100 @@ static void upmix_5_1_back(AVFilterContext *ctx,
dstrs[2 * n + 1] = rs_mag * sinf(r_phase);
}
+static void upmix_6_0(AVFilterContext *ctx,
+ float l_phase,
+ float r_phase,
+ float c_phase,
+ float mag_total,
+ float x, float y,
+ int n)
+{
+ AudioSurroundContext *s = ctx->priv;
+ float l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs;
+
+ dstl = (float *)s->output->extended_data[0];
+ dstr = (float *)s->output->extended_data[1];
+ dstc = (float *)s->output->extended_data[2];
+ dstb = (float *)s->output->extended_data[3];
+ dstls = (float *)s->output->extended_data[4];
+ dstrs = (float *)s->output->extended_data[5];
+
+ c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total;
+ b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total;
+ l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total;
+ r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total;
+ ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total;
+ rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total;
+
+ dstl[2 * n ] = l_mag * cosf(l_phase);
+ dstl[2 * n + 1] = l_mag * sinf(l_phase);
+
+ dstr[2 * n ] = r_mag * cosf(r_phase);
+ dstr[2 * n + 1] = r_mag * sinf(r_phase);
+
+ dstc[2 * n ] = c_mag * cosf(c_phase);
+ dstc[2 * n + 1] = c_mag * sinf(c_phase);
+
+ dstls[2 * n ] = ls_mag * cosf(l_phase);
+ dstls[2 * n + 1] = ls_mag * sinf(l_phase);
+
+ dstrs[2 * n ] = rs_mag * cosf(r_phase);
+ dstrs[2 * n + 1] = rs_mag * sinf(r_phase);
+
+ dstb[2 * n ] = b_mag * cosf(c_phase);
+ dstb[2 * n + 1] = b_mag * sinf(c_phase);
+}
+
+static void upmix_6_1(AVFilterContext *ctx,
+ float l_phase,
+ float r_phase,
+ float c_phase,
+ float mag_total,
+ float x, float y,
+ int n)
+{
+ AudioSurroundContext *s = ctx->priv;
+ float lfe_mag, l_mag, r_mag, ls_mag, rs_mag, c_mag, b_mag, *dstc, *dstb, *dstl, *dstr, *dstls, *dstrs, *dstlfe;
+
+ dstl = (float *)s->output->extended_data[0];
+ dstr = (float *)s->output->extended_data[1];
+ dstc = (float *)s->output->extended_data[2];
+ dstlfe = (float *)s->output->extended_data[3];
+ dstb = (float *)s->output->extended_data[4];
+ dstls = (float *)s->output->extended_data[5];
+ dstrs = (float *)s->output->extended_data[6];
+
+ get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &mag_total, s->lfe_mode);
+
+ c_mag = powf(1.f - fabsf(x), s->fc_x) * powf((y + 1.f) * .5f, s->fc_y) * mag_total;
+ b_mag = powf(1.f - fabsf(x), s->bc_x) * powf((1.f - y) * .5f, s->bc_y) * mag_total;
+ l_mag = powf(.5f * ( x + 1.f), s->fl_x) * powf((y + 1.f) * .5f, s->fl_y) * mag_total;
+ r_mag = powf(.5f * (-x + 1.f), s->fr_x) * powf((y + 1.f) * .5f, s->fr_y) * mag_total;
+ ls_mag = powf(.5f * ( x + 1.f), s->bl_x) * powf(1.f - ((y + 1.f) * .5f), s->bl_y) * mag_total;
+ rs_mag = powf(.5f * (-x + 1.f), s->br_x) * powf(1.f - ((y + 1.f) * .5f), s->br_y) * mag_total;
+
+ dstl[2 * n ] = l_mag * cosf(l_phase);
+ dstl[2 * n + 1] = l_mag * sinf(l_phase);
+
+ dstr[2 * n ] = r_mag * cosf(r_phase);
+ dstr[2 * n + 1] = r_mag * sinf(r_phase);
+
+ dstc[2 * n ] = c_mag * cosf(c_phase);
+ dstc[2 * n + 1] = c_mag * sinf(c_phase);
+
+ dstlfe[2 * n ] = lfe_mag * cosf(c_phase);
+ dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase);
+
+ dstls[2 * n ] = ls_mag * cosf(l_phase);
+ dstls[2 * n + 1] = ls_mag * sinf(l_phase);
+
+ dstrs[2 * n ] = rs_mag * cosf(r_phase);
+ dstrs[2 * n + 1] = rs_mag * sinf(r_phase);
+
+ dstb[2 * n ] = b_mag * cosf(c_phase);
+ dstb[2 * n + 1] = b_mag * sinf(c_phase);
+}
+
static void upmix_5_1_back_surround(AVFilterContext *ctx,
float l_phase,
float r_phase,
@@ -888,7 +1066,7 @@ static void upmix_7_1_5_1(AVFilterContext *ctx,
lb_mag = powf(.5f * (-xl + 1.f), s->bl_x) * powf((yl + 1.f) * .5f, s->bl_y) * mag_totall;
rb_mag = powf(.5f * (-xr + 1.f), s->br_x) * powf((yr + 1.f) * .5f, s->br_y) * mag_totalr;
ls_mag = powf(1.f - fabsf(xl), s->sl_x) * powf((yl + 1.f) * .5f, s->sl_y) * mag_totall;
- rs_mag = powf(1.f - fabsf(xr), s->sl_x) * powf((yr + 1.f) * .5f, s->sr_y) * mag_totalr;
+ rs_mag = powf(1.f - fabsf(xr), s->sr_x) * powf((yr + 1.f) * .5f, s->sr_y) * mag_totalr;
dstl[2 * n ] = fl_mag * cosf(fl_phase);
dstl[2 * n + 1] = fl_mag * sinf(fl_phase);
@@ -934,7 +1112,7 @@ static void filter_stereo(AVFilterContext *ctx)
float r_phase = atan2f(r_im, r_re);
float phase_dif = fabsf(l_phase - r_phase);
float mag_sum = l_mag + r_mag;
- float mag_dif = mag_sum < 0.000001 ? 0.f : (l_mag - r_mag) / mag_sum;
+ float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
float mag_total = hypotf(l_mag, r_mag);
float x, y;
@@ -942,6 +1120,7 @@ static void filter_stereo(AVFilterContext *ctx)
phase_dif = 2 * M_PI - phase_dif;
stereo_position(mag_dif, phase_dif, &x, &y);
+ stereo_transform(&x, &y, s->angle);
s->upmix_stereo(ctx, l_phase, r_phase, c_phase, mag_total, x, y, n);
}
@@ -969,7 +1148,7 @@ static void filter_surround(AVFilterContext *ctx)
float r_phase = atan2f(r_im, r_re);
float phase_dif = fabsf(l_phase - r_phase);
float mag_sum = l_mag + r_mag;
- float mag_dif = mag_sum < 0.000001 ? 0.f : (l_mag - r_mag) / mag_sum;
+ float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
float mag_total = hypotf(l_mag, r_mag);
float x, y;
@@ -977,6 +1156,7 @@ static void filter_surround(AVFilterContext *ctx)
phase_dif = 2 * M_PI - phase_dif;
stereo_position(mag_dif, phase_dif, &x, &y);
+ stereo_transform(&x, &y, s->angle);
s->upmix_3_0(ctx, l_phase, r_phase, c_phase, c_mag, mag_total, x, y, n);
}
@@ -1003,7 +1183,7 @@ static void filter_2_1(AVFilterContext *ctx)
float r_phase = atan2f(r_im, r_re);
float phase_dif = fabsf(l_phase - r_phase);
float mag_sum = l_mag + r_mag;
- float mag_dif = mag_sum < 0.000001 ? 0.f : (l_mag - r_mag) / mag_sum;
+ float mag_dif = mag_sum < 0.000001 ? FFDIFFSIGN(l_mag, r_mag) : (l_mag - r_mag) / mag_sum;
float mag_total = hypotf(l_mag, r_mag);
float x, y;
@@ -1011,6 +1191,7 @@ static void filter_2_1(AVFilterContext *ctx)
phase_dif = 2 * M_PI - phase_dif;
stereo_position(mag_dif, phase_dif, &x, &y);
+ stereo_transform(&x, &y, s->angle);
s->upmix_2_1(ctx, l_phase, r_phase, c_phase, mag_total, lfe_re, lfe_im, x, y, n);
}
@@ -1046,8 +1227,8 @@ static void filter_5_0_side(AVFilterContext *ctx)
float phase_difr = fabsf(fr_phase - sr_phase);
float magl_sum = fl_mag + sl_mag;
float magr_sum = fr_mag + sr_mag;
- float mag_difl = magl_sum < 0.000001 ? 0.f : (fl_mag - sl_mag) / magl_sum;
- float mag_difr = magr_sum < 0.000001 ? 0.f : (fr_mag - sr_mag) / magr_sum;
+ float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum;
+ float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum;
float mag_totall = hypotf(fl_mag, sl_mag);
float mag_totalr = hypotf(fr_mag, sr_mag);
float bl_phase = atan2f(fl_im + sl_im, fl_re + sl_re);
@@ -1105,8 +1286,8 @@ static void filter_5_1_side(AVFilterContext *ctx)
float phase_difr = fabsf(fr_phase - sr_phase);
float magl_sum = fl_mag + sl_mag;
float magr_sum = fr_mag + sr_mag;
- float mag_difl = magl_sum < 0.000001 ? 0.f : (fl_mag - sl_mag) / magl_sum;
- float mag_difr = magr_sum < 0.000001 ? 0.f : (fr_mag - sr_mag) / magr_sum;
+ float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, sl_mag) : (fl_mag - sl_mag) / magl_sum;
+ float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, sr_mag) : (fr_mag - sr_mag) / magr_sum;
float mag_totall = hypotf(fl_mag, sl_mag);
float mag_totalr = hypotf(fr_mag, sr_mag);
float bl_phase = atan2f(fl_im + sl_im, fl_re + sl_re);
@@ -1164,8 +1345,8 @@ static void filter_5_1_back(AVFilterContext *ctx)
float phase_difr = fabsf(fr_phase - br_phase);
float magl_sum = fl_mag + bl_mag;
float magr_sum = fr_mag + br_mag;
- float mag_difl = magl_sum < 0.000001 ? 0.f : (fl_mag - bl_mag) / magl_sum;
- float mag_difr = magr_sum < 0.000001 ? 0.f : (fr_mag - br_mag) / magr_sum;
+ float mag_difl = magl_sum < 0.000001 ? FFDIFFSIGN(fl_mag, bl_mag) : (fl_mag - bl_mag) / magl_sum;
+ float mag_difr = magr_sum < 0.000001 ? FFDIFFSIGN(fr_mag, br_mag) : (fr_mag - br_mag) / magr_sum;
float mag_totall = hypotf(fl_mag, bl_mag);
float mag_totalr = hypotf(fr_mag, br_mag);
float sl_phase = atan2f(fl_im + bl_im, fl_re + bl_re);
@@ -1246,6 +1427,12 @@ static int init(AVFilterContext *ctx)
case AV_CH_LAYOUT_5POINT1_BACK:
s->upmix_stereo = upmix_5_1_back;
break;
+ case AV_CH_LAYOUT_6POINT0:
+ s->upmix_stereo = upmix_6_0;
+ break;
+ case AV_CH_LAYOUT_6POINT1:
+ s->upmix_stereo = upmix_6_1;
+ break;
case AV_CH_LAYOUT_7POINT0:
s->upmix_stereo = upmix_7_0;
break;
@@ -1316,7 +1503,7 @@ fail:
return AVERROR(EINVAL);
}
- s->buf_size = 4096;
+ s->buf_size = 1 << av_log2(s->win_size);
s->pts = AV_NOPTS_VALUE;
s->window_func_lut = av_calloc(s->buf_size, sizeof(*s->window_func_lut));
@@ -1390,70 +1577,91 @@ static int ifft_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
return 0;
}
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+static int filter_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AVFilterLink *outlink = ctx->outputs[0];
AudioSurroundContext *s = ctx->priv;
+ AVFrame *out;
int ret;
- ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
- in->nb_samples);
- if (ret >= 0 && s->pts == AV_NOPTS_VALUE)
- s->pts = in->pts;
-
- av_frame_free(&in);
+ ret = av_audio_fifo_peek(s->fifo, (void **)s->input->extended_data, s->buf_size);
if (ret < 0)
return ret;
- while (av_audio_fifo_size(s->fifo) >= s->buf_size) {
- AVFrame *out;
+ ctx->internal->execute(ctx, fft_channel, NULL, NULL, inlink->channels);
- ret = av_audio_fifo_peek(s->fifo, (void **)s->input->extended_data, s->buf_size);
- if (ret < 0)
- return ret;
+ s->filter(ctx);
- ctx->internal->execute(ctx, fft_channel, NULL, NULL, inlink->channels);
+ out = ff_get_audio_buffer(outlink, s->hop_size);
+ if (!out)
+ return AVERROR(ENOMEM);
- s->filter(ctx);
+ ctx->internal->execute(ctx, ifft_channel, out, NULL, outlink->channels);
- out = ff_get_audio_buffer(outlink, s->hop_size);
- if (!out)
- return AVERROR(ENOMEM);
+ out->pts = s->pts;
+ if (s->pts != AV_NOPTS_VALUE)
+ s->pts += av_rescale_q(out->nb_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
+ av_audio_fifo_drain(s->fifo, FFMIN(av_audio_fifo_size(s->fifo), s->hop_size));
+
+ return ff_filter_frame(outlink, out);
+}
+
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AudioSurroundContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret = 0, status;
+ int64_t pts;
- ctx->internal->execute(ctx, ifft_channel, out, NULL, outlink->channels);
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- out->pts = s->pts;
- if (s->pts != AV_NOPTS_VALUE)
- s->pts += av_rescale_q(out->nb_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
- av_audio_fifo_drain(s->fifo, s->hop_size);
- ret = ff_filter_frame(outlink, out);
+ if (!s->eof && av_audio_fifo_size(s->fifo) < s->buf_size) {
+ ret = ff_inlink_consume_frame(inlink, &in);
if (ret < 0)
return ret;
- }
- return 0;
-}
+ if (ret > 0) {
+ ret = av_audio_fifo_write(s->fifo, (void **)in->extended_data,
+ in->nb_samples);
+ if (ret >= 0 && s->pts == AV_NOPTS_VALUE)
+ s->pts = in->pts;
-static int request_frame(AVFilterLink *outlink)
-{
- AVFilterContext *ctx = outlink->src;
- AudioSurroundContext *s = ctx->priv;
- int ret = 0;
+ av_frame_free(&in);
+ if (ret < 0)
+ return ret;
+ }
+ }
- ret = ff_request_frame(ctx->inputs[0]);
+ if ((av_audio_fifo_size(s->fifo) >= s->buf_size) ||
+ (av_audio_fifo_size(s->fifo) > 0 && s->eof)) {
+ ret = filter_frame(inlink);
+ if (av_audio_fifo_size(s->fifo) >= s->buf_size)
+ ff_filter_set_ready(ctx, 100);
+ return ret;
+ }
- if (ret == AVERROR_EOF && av_audio_fifo_size(s->fifo) > 0 && av_audio_fifo_size(s->fifo) < s->buf_size) {
- AVFrame *in;
+ if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF) {
+ s->eof = 1;
+ if (av_audio_fifo_size(s->fifo) >= 0) {
+ ff_filter_set_ready(ctx, 100);
+ return 0;
+ }
+ }
+ }
- in = ff_get_audio_buffer(outlink, s->buf_size - av_audio_fifo_size(s->fifo));
- if (!in)
- return AVERROR(ENOMEM);
- ret = filter_frame(ctx->inputs[0], in);
- av_audio_fifo_drain(s->fifo, s->buf_size);
+ if (s->eof && av_audio_fifo_size(s->fifo) <= 0) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+ return 0;
}
- return ret;
+ if (!s->eof)
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -1493,8 +1701,23 @@ static const AVOption surround_options[] = {
{ "lfe_mode", "set LFE channel mode", OFFSET(lfe_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "lfe_mode" },
{ "add", "just add LFE channel", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 1, FLAGS, "lfe_mode" },
{ "sub", "substract LFE channel with others", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, FLAGS, "lfe_mode" },
+ { "angle", "set soundfield transform angle", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl=90}, 0, 360, FLAGS },
{ "fc_in", "set front center channel input level", OFFSET(fc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
{ "fc_out", "set front center channel output level", OFFSET(fc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "fl_in", "set front left channel input level", OFFSET(fl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "fl_out", "set front left channel output level", OFFSET(fl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "fr_in", "set front right channel input level", OFFSET(fr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "fr_out", "set front right channel output level", OFFSET(fr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "sl_in", "set side left channel input level", OFFSET(sl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "sl_out", "set side left channel output level", OFFSET(sl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "sr_in", "set side right channel input level", OFFSET(sr_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "sr_out", "set side right channel output level", OFFSET(sr_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "bl_in", "set back left channel input level", OFFSET(bl_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "bl_out", "set back left channel output level", OFFSET(bl_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "br_in", "set back right channel input level", OFFSET(br_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "br_out", "set back right channel output level", OFFSET(br_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "bc_in", "set back center channel input level", OFFSET(bc_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
+ { "bc_out", "set back center channel output level", OFFSET(bc_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
{ "lfe_in", "set lfe channel input level", OFFSET(lfe_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
{ "lfe_out", "set lfe channel output level", OFFSET(lfe_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS },
{ "allx", "set all channel's x spread", OFFSET(all_x), AV_OPT_TYPE_FLOAT, {.dbl=-1}, -1, 15, FLAGS },
@@ -1515,6 +1738,7 @@ static const AVOption surround_options[] = {
{ "sly", "set side left channel y spread", OFFSET(sl_y), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 15, FLAGS },
{ "sry", "set side right channel y spread", OFFSET(sr_y), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 15, FLAGS },
{ "bcy", "set back center channel y spread", OFFSET(bc_y), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 15, FLAGS },
+ { "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
{ "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, FLAGS, "win_func" },
@@ -1547,7 +1771,6 @@ static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
@@ -1557,7 +1780,6 @@ static const AVFilterPad outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .request_frame = request_frame,
.config_props = config_output,
},
{ NULL }
@@ -1571,6 +1793,7 @@ AVFilter ff_af_surround = {
.priv_class = &surround_class,
.init = init,
.uninit = uninit,
+ .activate = activate,
.inputs = inputs,
.outputs = outputs,
.flags = AVFILTER_FLAG_SLICE_THREADS,
diff --git a/chromium/third_party/ffmpeg/libavfilter/allfilters.c b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
index 69ca204c102..04a3df7d56d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/allfilters.c
+++ b/chromium/third_party/ffmpeg/libavfilter/allfilters.c
@@ -72,7 +72,9 @@ extern AVFilter ff_af_asetrate;
extern AVFilter ff_af_asettb;
extern AVFilter ff_af_ashowinfo;
extern AVFilter ff_af_asidedata;
+extern AVFilter ff_af_asoftclip;
extern AVFilter ff_af_asplit;
+extern AVFilter ff_af_asr;
extern AVFilter ff_af_astats;
extern AVFilter ff_af_astreamselect;
extern AVFilter ff_af_atempo;
@@ -91,6 +93,7 @@ extern AVFilter ff_af_compensationdelay;
extern AVFilter ff_af_crossfeed;
extern AVFilter ff_af_crystalizer;
extern AVFilter ff_af_dcshift;
+extern AVFilter ff_af_deesser;
extern AVFilter ff_af_drmeter;
extern AVFilter ff_af_dynaudnorm;
extern AVFilter ff_af_earwax;
@@ -166,6 +169,7 @@ extern AVFilter ff_vf_colorbalance;
extern AVFilter ff_vf_colorchannelmixer;
extern AVFilter ff_vf_colorkey;
extern AVFilter ff_vf_colorkey_opencl;
+extern AVFilter ff_vf_colorhold;
extern AVFilter ff_vf_colorlevels;
extern AVFilter ff_vf_colormatrix;
extern AVFilter ff_vf_colorspace;
@@ -193,6 +197,7 @@ extern AVFilter ff_vf_deinterlace_vaapi;
extern AVFilter ff_vf_dejudder;
extern AVFilter ff_vf_delogo;
extern AVFilter ff_vf_denoise_vaapi;
+extern AVFilter ff_vf_derain;
extern AVFilter ff_vf_deshake;
extern AVFilter ff_vf_despill;
extern AVFilter ff_vf_detelecine;
@@ -279,6 +284,7 @@ extern AVFilter ff_vf_mix;
extern AVFilter ff_vf_mpdecimate;
extern AVFilter ff_vf_negate;
extern AVFilter ff_vf_nlmeans;
+extern AVFilter ff_vf_nlmeans_opencl;
extern AVFilter ff_vf_nnedi;
extern AVFilter ff_vf_noformat;
extern AVFilter ff_vf_noise;
@@ -398,6 +404,7 @@ extern AVFilter ff_vf_w3fdif;
extern AVFilter ff_vf_waveform;
extern AVFilter ff_vf_weave;
extern AVFilter ff_vf_xbr;
+extern AVFilter ff_vf_xmedian;
extern AVFilter ff_vf_xstack;
extern AVFilter ff_vf_yadif;
extern AVFilter ff_vf_yadif_cuda;
@@ -438,6 +445,7 @@ extern AVFilter ff_avf_avectorscope;
extern AVFilter ff_avf_concat;
extern AVFilter ff_avf_showcqt;
extern AVFilter ff_avf_showfreqs;
+extern AVFilter ff_avf_showspatial;
extern AVFilter ff_avf_showspectrum;
extern AVFilter ff_avf_showspectrumpic;
extern AVFilter ff_avf_showvolume;
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_abitscope.c b/chromium/third_party/ffmpeg/libavfilter/avf_abitscope.c
index 0e3eaa422e3..6a38521b6ca 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_abitscope.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_abitscope.c
@@ -24,6 +24,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
@@ -36,6 +37,7 @@ typedef struct AudioBitScopeContext {
char *colors;
int nb_channels;
+ int nb_samples;
int depth;
uint8_t *fg;
@@ -91,13 +93,10 @@ static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AudioBitScopeContext *s = ctx->priv;
- int ch, nb_samples;
+ int ch;
char *colors, *saveptr = NULL;
- nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = nb_samples;
+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
s->nb_channels = inlink->channels;
s->depth = inlink->format == AV_SAMPLE_FMT_S16P ? 16 : 32;
@@ -222,12 +221,33 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return ff_filter_frame(outlink, outpicref);
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AudioBitScopeContext *s = ctx->priv;
+ AVFrame *in;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -248,5 +268,6 @@ AVFilter ff_avf_abitscope = {
.priv_size = sizeof(AudioBitScopeContext),
.inputs = inputs,
.outputs = outputs,
+ .activate = activate,
.priv_class = &abitscope_class,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_ahistogram.c b/chromium/third_party/ffmpeg/libavfilter/avf_ahistogram.c
index 587415175b5..a0931bfa58a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_ahistogram.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_ahistogram.c
@@ -22,6 +22,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
@@ -54,6 +55,7 @@ typedef struct AudioHistogramContext {
float *combine_buffer;
AVFrame *in[101];
int first;
+ int nb_samples;
} AudioHistogramContext;
#define OFFSET(x) offsetof(AudioHistogramContext, x)
@@ -117,13 +119,8 @@ static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AudioHistogramContext *s = ctx->priv;
- int nb_samples;
-
- nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = nb_samples;
+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
s->dchannels = s->dmode == SINGLE ? 1 : inlink->channels;
s->shistogram = av_calloc(s->w, s->dchannels * sizeof(*s->shistogram));
if (!s->shistogram)
@@ -369,6 +366,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, av_frame_clone(s->out));
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AudioHistogramContext *s = ctx->priv;
+ AVFrame *in;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold void uninit(AVFilterContext *ctx)
{
AudioHistogramContext *s = ctx->priv;
@@ -382,17 +401,16 @@ static av_cold void uninit(AVFilterContext *ctx)
av_frame_free(&s->in[i]);
}
-static const AVFilterPad audiovectorscope_inputs[] = {
+static const AVFilterPad ahistogram_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
-static const AVFilterPad audiovectorscope_outputs[] = {
+static const AVFilterPad ahistogram_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
@@ -407,7 +425,8 @@ AVFilter ff_avf_ahistogram = {
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(AudioHistogramContext),
- .inputs = audiovectorscope_inputs,
- .outputs = audiovectorscope_outputs,
+ .activate = activate,
+ .inputs = ahistogram_inputs,
+ .outputs = ahistogram_outputs,
.priv_class = &ahistogram_class,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c b/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c
index ed837059eaa..f497bc99697 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_aphasemeter.c
@@ -106,7 +106,7 @@ static int config_input(AVFilterLink *inlink)
int nb_samples;
if (s->do_video) {
- nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
+ nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
inlink->partial_buf_size =
inlink->min_samples =
inlink->max_samples = nb_samples;
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
index af9f1da1ec0..0f53b36dfba 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_avectorscope.c
@@ -28,6 +28,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
@@ -69,6 +70,7 @@ typedef struct AudioVectorScopeContext {
int mirror;
unsigned prev_x, prev_y;
AVRational frame_rate;
+ int nb_samples;
} AudioVectorScopeContext;
#define OFFSET(x) offsetof(AudioVectorScopeContext, x)
@@ -208,12 +210,8 @@ static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
AudioVectorScopeContext *s = ctx->priv;
- int nb_samples;
- nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = nb_samples;
+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
return 0;
}
@@ -365,6 +363,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return ff_filter_frame(outlink, av_frame_clone(s->outpicref));
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AudioVectorScopeContext *s = ctx->priv;
+ AVFrame *in;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold void uninit(AVFilterContext *ctx)
{
AudioVectorScopeContext *s = ctx->priv;
@@ -377,7 +397,6 @@ static const AVFilterPad audiovectorscope_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -397,6 +416,7 @@ AVFilter ff_avf_avectorscope = {
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(AudioVectorScopeContext),
+ .activate = activate,
.inputs = audiovectorscope_inputs,
.outputs = audiovectorscope_outputs,
.priv_class = &avectorscope_class,
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c b/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c
index ff6a762547f..8755ac3a9ee 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showfreqs.c
@@ -30,6 +30,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "audio.h"
+#include "filters.h"
#include "video.h"
#include "avfilter.h"
#include "internal.h"
@@ -45,6 +46,7 @@ typedef struct ShowFreqsContext {
int w, h;
int mode;
int cmode;
+ int fft_size;
int fft_bits;
int ascale, fscale;
int avg;
@@ -84,20 +86,7 @@ static const AVOption showfreqs_options[] = {
{ "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=FS_LINEAR}, 0, 0, FLAGS, "fscale" },
{ "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=FS_LOG}, 0, 0, FLAGS, "fscale" },
{ "rlog", "reverse logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=FS_RLOG}, 0, 0, FLAGS, "fscale" },
- { "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, {.i64=11}, 4, 16, FLAGS, "fft" },
- { "w16", 0, 0, AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, FLAGS, "fft" },
- { "w32", 0, 0, AV_OPT_TYPE_CONST, {.i64=5}, 0, 0, FLAGS, "fft" },
- { "w64", 0, 0, AV_OPT_TYPE_CONST, {.i64=6}, 0, 0, FLAGS, "fft" },
- { "w128", 0, 0, AV_OPT_TYPE_CONST, {.i64=7}, 0, 0, FLAGS, "fft" },
- { "w256", 0, 0, AV_OPT_TYPE_CONST, {.i64=8}, 0, 0, FLAGS, "fft" },
- { "w512", 0, 0, AV_OPT_TYPE_CONST, {.i64=9}, 0, 0, FLAGS, "fft" },
- { "w1024", 0, 0, AV_OPT_TYPE_CONST, {.i64=10}, 0, 0, FLAGS, "fft" },
- { "w2048", 0, 0, AV_OPT_TYPE_CONST, {.i64=11}, 0, 0, FLAGS, "fft" },
- { "w4096", 0, 0, AV_OPT_TYPE_CONST, {.i64=12}, 0, 0, FLAGS, "fft" },
- { "w8192", 0, 0, AV_OPT_TYPE_CONST, {.i64=13}, 0, 0, FLAGS, "fft" },
- { "w16384", 0, 0, AV_OPT_TYPE_CONST, {.i64=14}, 0, 0, FLAGS, "fft" },
- { "w32768", 0, 0, AV_OPT_TYPE_CONST, {.i64=15}, 0, 0, FLAGS, "fft" },
- { "w65536", 0, 0, AV_OPT_TYPE_CONST, {.i64=16}, 0, 0, FLAGS, "fft" },
+ { "win_size", "set window size", OFFSET(fft_size), AV_OPT_TYPE_INT, {.i64=2048}, 16, 65536, FLAGS },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64=WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
{ "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, FLAGS, "win_func" },
@@ -179,6 +168,7 @@ static int config_output(AVFilterLink *outlink)
float overlap;
int i;
+ s->fft_bits = av_log2(s->fft_size);
s->nb_freq = 1 << (s->fft_bits - 1);
s->win_size = s->nb_freq << 1;
av_audio_fifo_free(s->fifo);
@@ -439,45 +429,66 @@ static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, out);
}
-static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+static int filter_frame(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
ShowFreqsContext *s = ctx->priv;
AVFrame *fin = NULL;
- int consumed = 0;
int ret = 0;
- if (s->pts == AV_NOPTS_VALUE)
- s->pts = in->pts - av_audio_fifo_size(s->fifo);
+ fin = ff_get_audio_buffer(inlink, s->win_size);
+ if (!fin) {
+ ret = AVERROR(ENOMEM);
+ goto fail;
+ }
- av_audio_fifo_write(s->fifo, (void **)in->extended_data, in->nb_samples);
- while (av_audio_fifo_size(s->fifo) >= s->win_size) {
- fin = ff_get_audio_buffer(inlink, s->win_size);
- if (!fin) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
+ fin->pts = s->pts;
+ s->pts += s->hop_size;
+ ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data, s->win_size);
+ if (ret < 0)
+ goto fail;
- fin->pts = s->pts + consumed;
- consumed += s->hop_size;
- ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data, s->win_size);
- if (ret < 0)
- goto fail;
-
- ret = plot_freqs(inlink, fin);
- av_frame_free(&fin);
- av_audio_fifo_drain(s->fifo, s->hop_size);
- if (ret < 0)
- goto fail;
- }
+ ret = plot_freqs(inlink, fin);
+ av_frame_free(&fin);
+ av_audio_fifo_drain(s->fifo, s->hop_size);
fail:
- s->pts = AV_NOPTS_VALUE;
av_frame_free(&fin);
- av_frame_free(&in);
return ret;
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowFreqsContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret = 0;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ if (av_audio_fifo_size(s->fifo) < s->win_size)
+ ret = ff_inlink_consume_samples(inlink, s->win_size, s->win_size, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ av_audio_fifo_write(s->fifo, (void **)in->extended_data, in->nb_samples);
+ if (s->pts == AV_NOPTS_VALUE)
+ s->pts = in->pts;
+ }
+
+ if (av_audio_fifo_size(s->fifo) >= s->win_size) {
+ ret = filter_frame(inlink);
+ if (ret <= 0)
+ return ret;
+ }
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold void uninit(AVFilterContext *ctx)
{
ShowFreqsContext *s = ctx->priv;
@@ -500,7 +511,6 @@ static const AVFilterPad showfreqs_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -521,6 +531,7 @@ AVFilter ff_avf_showfreqs = {
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowFreqsContext),
+ .activate = activate,
.inputs = showfreqs_inputs,
.outputs = showfreqs_outputs,
.priv_class = &showfreqs_class,
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showspatial.c b/chromium/third_party/ffmpeg/libavfilter/avf_showspatial.c
new file mode 100644
index 00000000000..80109a30554
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showspatial.c
@@ -0,0 +1,372 @@
+/*
+ * Copyright (c) 2019 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 <float.h>
+#include <math.h>
+
+#include "libavcodec/avfft.h"
+#include "libavutil/audio_fifo.h"
+#include "libavutil/avassert.h"
+#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "audio.h"
+#include "video.h"
+#include "avfilter.h"
+#include "filters.h"
+#include "internal.h"
+#include "window_func.h"
+
+typedef struct ShowSpatialContext {
+ const AVClass *class;
+ int w, h;
+ AVRational frame_rate;
+ FFTContext *fft[2]; ///< Fast Fourier Transform context
+ FFTContext *ifft[2]; ///< Inverse Fast Fourier Transform context
+ int fft_bits; ///< number of bits (FFT window size = 1<<fft_bits)
+ FFTComplex *fft_data[2]; ///< bins holder for each (displayed) channels
+ float *window_func_lut; ///< Window function LUT
+ int win_func;
+ int win_size;
+ int buf_size;
+ float overlap;
+ int consumed;
+ int hop_size;
+ AVAudioFifo *fifo;
+ int64_t pts;
+} ShowSpatialContext;
+
+#define OFFSET(x) offsetof(ShowSpatialContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption showspatial_options[] = {
+ { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
+ { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "512x512"}, 0, 0, FLAGS },
+ { "win_size", "set window size", OFFSET(win_size), AV_OPT_TYPE_INT, {.i64 = 4096}, 1024, 65536, FLAGS },
+ { "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
+ { "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
+ { "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, FLAGS, "win_func" },
+ { "hann", "Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, FLAGS, "win_func" },
+ { "hanning", "Hanning", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, FLAGS, "win_func" },
+ { "hamming", "Hamming", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HAMMING}, 0, 0, FLAGS, "win_func" },
+ { "blackman", "Blackman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BLACKMAN}, 0, 0, FLAGS, "win_func" },
+ { "welch", "Welch", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_WELCH}, 0, 0, FLAGS, "win_func" },
+ { "flattop", "Flat-top", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_FLATTOP}, 0, 0, FLAGS, "win_func" },
+ { "bharris", "Blackman-Harris", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHARRIS}, 0, 0, FLAGS, "win_func" },
+ { "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BNUTTALL}, 0, 0, FLAGS, "win_func" },
+ { "bhann", "Bartlett-Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHANN}, 0, 0, FLAGS, "win_func" },
+ { "sine", "Sine", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE}, 0, 0, FLAGS, "win_func" },
+ { "nuttall", "Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_NUTTALL}, 0, 0, FLAGS, "win_func" },
+ { "lanczos", "Lanczos", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_LANCZOS}, 0, 0, FLAGS, "win_func" },
+ { "gauss", "Gauss", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_GAUSS}, 0, 0, FLAGS, "win_func" },
+ { "tukey", "Tukey", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_TUKEY}, 0, 0, FLAGS, "win_func" },
+ { "dolph", "Dolph-Chebyshev", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_DOLPH}, 0, 0, FLAGS, "win_func" },
+ { "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, FLAGS, "win_func" },
+ { "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, FLAGS, "win_func" },
+ { "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, FLAGS, "win_func" },
+ { "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, FLAGS, "win_func" },
+ { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, {.dbl=0.5}, 0, 1, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(showspatial);
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ShowSpatialContext *s = ctx->priv;
+ int i;
+
+ for (i = 0; i < 2; i++)
+ av_fft_end(s->fft[i]);
+ for (i = 0; i < 2; i++)
+ av_fft_end(s->ifft[i]);
+ for (i = 0; i < 2; i++)
+ av_freep(&s->fft_data[i]);
+ av_freep(&s->window_func_lut);
+ av_audio_fifo_free(s->fifo);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats = NULL;
+ AVFilterChannelLayouts *layout = NULL;
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE };
+ static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GBRP, AV_PIX_FMT_NONE };
+ int ret;
+
+ formats = ff_make_format_list(sample_fmts);
+ if ((ret = ff_formats_ref (formats, &inlink->out_formats )) < 0 ||
+ (ret = ff_add_channel_layout (&layout, AV_CH_LAYOUT_STEREO )) < 0 ||
+ (ret = ff_channel_layouts_ref (layout , &inlink->out_channel_layouts)) < 0)
+ return ret;
+
+ formats = ff_all_samplerates();
+ if ((ret = ff_formats_ref(formats, &inlink->out_samplerates)) < 0)
+ return ret;
+
+ formats = ff_make_format_list(pix_fmts);
+ if ((ret = ff_formats_ref(formats, &outlink->in_formats)) < 0)
+ return ret;
+
+ return 0;
+}
+
+static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ ShowSpatialContext *s = ctx->priv;
+ const float *window_func_lut = s->window_func_lut;
+ AVFrame *fin = arg;
+ const int ch = jobnr;
+ const float *p = (float *)fin->extended_data[ch];
+
+ for (int n = 0; n < fin->nb_samples; n++) {
+ s->fft_data[ch][n].re = p[n] * window_func_lut[n];
+ s->fft_data[ch][n].im = 0;
+ }
+
+ av_fft_permute(s->fft[ch], s->fft_data[ch]);
+ av_fft_calc(s->fft[ch], s->fft_data[ch]);
+
+ return 0;
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ AVFilterLink *inlink = ctx->inputs[0];
+ ShowSpatialContext *s = ctx->priv;
+ int i, fft_bits;
+ float overlap;
+
+ outlink->w = s->w;
+ outlink->h = s->h;
+ outlink->sample_aspect_ratio = (AVRational){1,1};
+
+ s->buf_size = 1 << av_log2(s->win_size);
+ s->win_size = s->buf_size;
+ fft_bits = av_log2(s->win_size);
+
+ /* (re-)configuration if the video output changed (or first init) */
+ if (fft_bits != s->fft_bits) {
+ s->fft_bits = fft_bits;
+
+ /* FFT buffers: x2 for each channel buffer.
+ * Note: we use free and malloc instead of a realloc-like function to
+ * make sure the buffer is aligned in memory for the FFT functions. */
+ for (i = 0; i < 2; i++) {
+ av_fft_end(s->fft[i]);
+ av_freep(&s->fft_data[i]);
+ }
+ for (i = 0; i < 2; i++) {
+ s->fft[i] = av_fft_init(fft_bits, 0);
+ if (!s->fft[i]) {
+ av_log(ctx, AV_LOG_ERROR, "Unable to create FFT context. "
+ "The window size might be too high.\n");
+ return AVERROR(EINVAL);
+ }
+ }
+
+ for (i = 0; i < 2; i++) {
+ s->fft_data[i] = av_calloc(s->buf_size, sizeof(**s->fft_data));
+ if (!s->fft_data[i])
+ return AVERROR(ENOMEM);
+ }
+
+ /* pre-calc windowing function */
+ s->window_func_lut =
+ av_realloc_f(s->window_func_lut, s->win_size,
+ sizeof(*s->window_func_lut));
+ if (!s->window_func_lut)
+ return AVERROR(ENOMEM);
+ generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
+ if (s->overlap == 1)
+ s->overlap = overlap;
+
+ s->hop_size = (1.f - s->overlap) * s->win_size;
+ if (s->hop_size < 1) {
+ av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
+ return AVERROR(EINVAL);
+ }
+ }
+
+ outlink->time_base = av_inv_q(outlink->frame_rate);
+
+ av_audio_fifo_free(s->fifo);
+ s->fifo = av_audio_fifo_alloc(inlink->format, inlink->channels, s->win_size);
+ if (!s->fifo)
+ return AVERROR(ENOMEM);
+ return 0;
+}
+
+#define RE(y, ch) s->fft_data[ch][y].re
+#define IM(y, ch) s->fft_data[ch][y].im
+
+static void draw_dot(uint8_t *dst, int linesize, int value)
+{
+ dst[0] = value;
+ dst[1] = value;
+ dst[-1] = value;
+ dst[linesize] = value;
+ dst[-linesize] = value;
+}
+
+static int draw_spatial(AVFilterLink *inlink, AVFrame *insamples)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowSpatialContext *s = ctx->priv;
+ AVFrame *outpicref;
+ int h = s->h - 2;
+ int w = s->w - 2;
+ int z = s->win_size / 2;
+
+ outpicref = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!outpicref)
+ return AVERROR(ENOMEM);
+
+ outpicref->sample_aspect_ratio = (AVRational){1,1};
+ for (int i = 0; i < outlink->h; i++) {
+ memset(outpicref->data[0] + i * outpicref->linesize[0], 0, outlink->w);
+ memset(outpicref->data[1] + i * outpicref->linesize[1], 0, outlink->w);
+ memset(outpicref->data[2] + i * outpicref->linesize[2], 0, outlink->w);
+ }
+
+ for (int j = 0; j < z; j++) {
+ const int idx = z - 1 - j;
+ float l = hypotf(RE(idx, 0), IM(idx, 0));
+ float r = hypotf(RE(idx, 1), IM(idx, 1));
+ float sum = l + r;
+ float lp = atan2f(IM(idx, 0), RE(idx, 0));
+ float rp = atan2f(IM(idx, 1), RE(idx, 1));
+ float diffp = ((rp - lp) / (2.f * M_PI) + 1.f) * 0.5f;
+ float diff = (sum < 0.000001f ? 0.f : (r - l) / sum) * 0.5f + 0.5f;
+ float cr = av_clipf(cbrtf(l / sum), 0, 1) * 255.f;
+ float cb = av_clipf(cbrtf(r / sum), 0, 1) * 255.f;
+ float cg;
+ int x, y;
+
+ cg = diffp * 255.f;
+ x = av_clip(w * diff, 0, w - 2) + 1;
+ y = av_clip(h * diffp, 0, h - 2) + 1;
+
+ draw_dot(outpicref->data[0] + outpicref->linesize[0] * y + x, outpicref->linesize[0], cg);
+ draw_dot(outpicref->data[1] + outpicref->linesize[1] * y + x, outpicref->linesize[1], cb);
+ draw_dot(outpicref->data[2] + outpicref->linesize[2] * y + x, outpicref->linesize[2], cr);
+ }
+
+ outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
+
+ return ff_filter_frame(outlink, outpicref);
+}
+
+static int spatial_activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowSpatialContext *s = ctx->priv;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ if (av_audio_fifo_size(s->fifo) < s->win_size) {
+ AVFrame *frame = NULL;
+
+ ret = ff_inlink_consume_frame(inlink, &frame);
+ if (ret < 0)
+ return ret;
+ if (ret > 0) {
+ s->pts = frame->pts;
+ s->consumed = 0;
+
+ av_audio_fifo_write(s->fifo, (void **)frame->extended_data, frame->nb_samples);
+ av_frame_free(&frame);
+ }
+ }
+
+ if (av_audio_fifo_size(s->fifo) >= s->win_size) {
+ AVFrame *fin = ff_get_audio_buffer(inlink, s->win_size);
+ if (!fin)
+ return AVERROR(ENOMEM);
+
+ fin->pts = s->pts + s->consumed;
+ s->consumed += s->hop_size;
+ ret = av_audio_fifo_peek(s->fifo, (void **)fin->extended_data,
+ FFMIN(s->win_size, av_audio_fifo_size(s->fifo)));
+ if (ret < 0) {
+ av_frame_free(&fin);
+ return ret;
+ }
+
+ av_assert0(fin->nb_samples == s->win_size);
+
+ ctx->internal->execute(ctx, run_channel_fft, fin, NULL, 2);
+
+ ret = draw_spatial(inlink, fin);
+
+ av_frame_free(&fin);
+ av_audio_fifo_drain(s->fifo, s->hop_size);
+ if (ret <= 0)
+ return ret;
+ }
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ if (ff_outlink_frame_wanted(outlink) && av_audio_fifo_size(s->fifo) < s->win_size) {
+ ff_inlink_request_frame(inlink);
+ return 0;
+ }
+
+ if (av_audio_fifo_size(s->fifo) >= s->win_size) {
+ ff_filter_set_ready(ctx, 10);
+ return 0;
+ }
+ return FFERROR_NOT_READY;
+}
+
+static const AVFilterPad showspatial_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_AUDIO,
+ },
+ { NULL }
+};
+
+static const AVFilterPad showspatial_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_avf_showspatial = {
+ .name = "showspatial",
+ .description = NULL_IF_CONFIG_SMALL("Convert input audio to a spatial video output."),
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .priv_size = sizeof(ShowSpatialContext),
+ .inputs = showspatial_inputs,
+ .outputs = showspatial_outputs,
+ .activate = spatial_activate,
+ .priv_class = &showspatial_class,
+ .flags = AVFILTER_FLAG_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c b/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
index e8d3f1ec8d2..f175bf1cb54 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showspectrum.c
@@ -45,6 +45,7 @@
enum DisplayMode { COMBINED, SEPARATE, NB_MODES };
enum DataMode { D_MAGNITUDE, D_PHASE, NB_DMODES };
+enum FrequencyScale { F_LINEAR, F_LOG, NB_FSCALES };
enum DisplayScale { LINEAR, SQRT, CBRT, LOG, FOURTHRT, FIFTHRT, NB_SCALES };
enum ColorMode { CHANNEL, INTENSITY, RAINBOW, MORELAND, NEBULAE, FIRE, FIERY, FRUIT, COOL, MAGMA, GREEN, VIRIDIS, PLASMA, CIVIDIS, TERRAIN, NB_CLMODES };
enum SlideMode { REPLACE, SCROLL, FULLFRAME, RSCROLL, NB_SLIDES };
@@ -65,6 +66,7 @@ typedef struct ShowSpectrumContext {
int mode; ///< channel display mode
int color_mode; ///< display color scheme
int scale;
+ int fscale;
float saturation; ///< color saturation multiplier
float rotation; ///< color rotation
int start, stop; ///< zoom mode
@@ -95,6 +97,7 @@ typedef struct ShowSpectrumContext {
int single_pic;
int legend;
int start_x, start_y;
+ int (*plot_channel)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
} ShowSpectrumContext;
#define OFFSET(x) offsetof(ShowSpectrumContext, x)
@@ -134,6 +137,9 @@ static const AVOption showspectrum_options[] = {
{ "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=LOG}, 0, 0, FLAGS, "scale" },
{ "4thrt","4th root", 0, AV_OPT_TYPE_CONST, {.i64=FOURTHRT}, 0, 0, FLAGS, "scale" },
{ "5thrt","5th root", 0, AV_OPT_TYPE_CONST, {.i64=FIFTHRT}, 0, 0, FLAGS, "scale" },
+ { "fscale", "set frequency scale", OFFSET(fscale), AV_OPT_TYPE_INT, {.i64=F_LINEAR}, 0, NB_FSCALES-1, FLAGS, "fscale" },
+ { "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=F_LINEAR}, 0, 0, FLAGS, "fscale" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=F_LOG}, 0, 0, FLAGS, "fscale" },
{ "saturation", "color saturation multiplier", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl = 1}, -10, 10, FLAGS },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
@@ -386,29 +392,29 @@ static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
}
if (s->stop) {
- double theta, phi, psi, a, b, S, c;
+ float theta, phi, psi, a, b, S, c;
FFTComplex *g = s->fft_data[ch];
FFTComplex *h = s->fft_scratch[ch];
int L = s->buf_size;
int N = s->win_size;
int M = s->win_size / 2;
- phi = 2.0 * M_PI * (s->stop - s->start) / (double)inlink->sample_rate / (M - 1);
- theta = 2.0 * M_PI * s->start / (double)inlink->sample_rate;
+ phi = 2.f * M_PI * (s->stop - s->start) / (float)inlink->sample_rate / (M - 1);
+ theta = 2.f * M_PI * s->start / (float)inlink->sample_rate;
for (int n = 0; n < M; n++) {
- h[n].re = cos(n * n / 2.0 * phi);
- h[n].im = sin(n * n / 2.0 * phi);
+ h[n].re = cosf(n * n / 2.f * phi);
+ h[n].im = sinf(n * n / 2.f * phi);
}
for (int n = M; n < L; n++) {
- h[n].re = 0.0;
- h[n].im = 0.0;
+ h[n].re = 0.f;
+ h[n].im = 0.f;
}
for (int n = L - N; n < L; n++) {
- h[n].re = cos((L - n) * (L - n) / 2.0 * phi);
- h[n].im = sin((L - n) * (L - n) / 2.0 * phi);
+ h[n].re = cosf((L - n) * (L - n) / 2.f * phi);
+ h[n].im = sinf((L - n) * (L - n) / 2.f * phi);
}
for (int n = 0; n < N; n++) {
@@ -417,14 +423,14 @@ static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
}
for (int n = N; n < L; n++) {
- g[n].re = 0.;
- g[n].im = 0.;
+ g[n].re = 0.f;
+ g[n].im = 0.f;
}
for (int n = 0; n < N; n++) {
- psi = n * theta + n * n / 2.0 * phi;
- c = cos(psi);
- S = -sin(psi);
+ psi = n * theta + n * n / 2.f * phi;
+ c = cosf(psi);
+ S = -sinf(psi);
a = c * g[n].re - S * g[n].im;
b = S * g[n].re + c * g[n].im;
g[n].re = a;
@@ -451,9 +457,9 @@ static int run_channel_fft(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
av_fft_calc(s->ifft[ch], g);
for (int k = 0; k < M; k++) {
- psi = k * k / 2.0 * phi;
- c = cos(psi);
- S = -sin(psi);
+ psi = k * k / 2.f * phi;
+ c = cosf(psi);
+ S = -sinf(psi);
a = c * g[k].re - S * g[k].im;
b = S * g[k].re + c * g[k].im;
s->fft_data[ch][k].re = a;
@@ -549,15 +555,15 @@ static void color_range(ShowSpectrumContext *s, int ch,
if (s->color_mode == CHANNEL) {
if (s->nb_display_channels > 1) {
- *uf *= 0.5 * sin((2 * M_PI * ch) / s->nb_display_channels + M_PI * s->rotation);
- *vf *= 0.5 * cos((2 * M_PI * ch) / s->nb_display_channels + M_PI * s->rotation);
+ *uf *= 0.5f * sinf((2 * M_PI * ch) / s->nb_display_channels + M_PI * s->rotation);
+ *vf *= 0.5f * cosf((2 * M_PI * ch) / s->nb_display_channels + M_PI * s->rotation);
} else {
- *uf *= 0.5 * sin(M_PI * s->rotation);
- *vf *= 0.5 * cos(M_PI * s->rotation + M_PI_2);
+ *uf *= 0.5f * sinf(M_PI * s->rotation);
+ *vf *= 0.5f * cosf(M_PI * s->rotation + M_PI_2);
}
} else {
- *uf += *uf * sin(M_PI * s->rotation);
- *vf += *vf * cos(M_PI * s->rotation + M_PI_2);
+ *uf += *uf * sinf(M_PI * s->rotation);
+ *vf += *vf * cosf(M_PI * s->rotation + M_PI_2);
}
*uf *= s->saturation;
@@ -623,6 +629,56 @@ static char *get_time(AVFilterContext *ctx, float seconds, int x)
return units;
}
+static float log_scale(const float value, const float min, const float max)
+{
+ if (value < min)
+ return min;
+ if (value > max)
+ return max;
+
+ {
+ const float b = logf(max / min) / (max - min);
+ const float a = max / expf(max * b);
+
+ return expf(value * b) * a;
+ }
+}
+
+static float get_log_hz(const int bin, const int num_bins, const float sample_rate)
+{
+ const float max_freq = sample_rate / 2;
+ const float hz_per_bin = max_freq / num_bins;
+ const float freq = hz_per_bin * bin;
+ const float scaled_freq = log_scale(freq + 1, 21, max_freq) - 1;
+
+ return num_bins * scaled_freq / max_freq;
+}
+
+static float inv_log_scale(const float value, const float min, const float max)
+{
+ if (value < min)
+ return min;
+ if (value > max)
+ return max;
+
+ {
+ const float b = logf(max / min) / (max - min);
+ const float a = max / expf(max * b);
+
+ return logf(value / a) / b;
+ }
+}
+
+static float bin_pos(const int bin, const int num_bins, const float sample_rate)
+{
+ const float max_freq = sample_rate / 2;
+ const float hz_per_bin = max_freq / num_bins;
+ const float freq = hz_per_bin * bin;
+ const float scaled_freq = inv_log_scale(freq + 1, 21, max_freq) - 1;
+
+ return num_bins * scaled_freq / max_freq;
+}
+
static int draw_legend(AVFilterContext *ctx, int samples)
{
ShowSpectrumContext *s = ctx->priv;
@@ -691,7 +747,8 @@ static int draw_legend(AVFilterContext *ctx, int samples)
}
for (y = 0; y < h; y += 40) {
float range = s->stop ? s->stop - s->start : inlink->sample_rate / 2;
- float hertz = s->start + y * range / (float)(1 << (int)ceil(log2(h)));
+ float bin = s->fscale == F_LINEAR ? y : get_log_hz(y, h, inlink->sample_rate);
+ float hertz = s->start + bin * range / (float)(1 << (int)ceil(log2(h)));
char *units;
if (hertz == 0)
@@ -746,7 +803,8 @@ static int draw_legend(AVFilterContext *ctx, int samples)
}
for (x = 0; x < w - 79; x += 80) {
float range = s->stop ? s->stop - s->start : inlink->sample_rate / 2;
- float hertz = s->start + x * range / (float)(1 << (int)ceil(log2(w)));
+ float bin = s->fscale == F_LINEAR ? x : get_log_hz(x, w, inlink->sample_rate);
+ float hertz = s->start + bin * range / (float)(1 << (int)ceil(log2(w)));
char *units;
if (hertz == 0)
@@ -796,7 +854,7 @@ static int draw_legend(AVFilterContext *ctx, int samples)
}
for (y = 0; ch == 0 && y < h; y += h / 10) {
- float value = 120.0 * log10(1. - y / (float)h);
+ float value = 120.f * log10f(1.f - y / (float)h);
char *text;
if (value < -120)
@@ -812,6 +870,110 @@ static int draw_legend(AVFilterContext *ctx, int samples)
return 0;
}
+static float get_value(AVFilterContext *ctx, int ch, int y)
+{
+ ShowSpectrumContext *s = ctx->priv;
+ float *magnitudes = s->magnitudes[ch];
+ float *phases = s->phases[ch];
+ float a;
+
+ switch (s->data) {
+ case D_MAGNITUDE:
+ /* get magnitude */
+ a = magnitudes[y];
+ break;
+ case D_PHASE:
+ /* get phase */
+ a = phases[y];
+ break;
+ default:
+ av_assert0(0);
+ }
+
+ /* apply scale */
+ switch (s->scale) {
+ case LINEAR:
+ a = av_clipf(a, 0, 1);
+ break;
+ case SQRT:
+ a = av_clipf(sqrtf(a), 0, 1);
+ break;
+ case CBRT:
+ a = av_clipf(cbrtf(a), 0, 1);
+ break;
+ case FOURTHRT:
+ a = av_clipf(sqrtf(sqrtf(a)), 0, 1);
+ break;
+ case FIFTHRT:
+ a = av_clipf(powf(a, 0.20), 0, 1);
+ break;
+ case LOG:
+ a = 1.f + log10f(av_clipf(a, 1e-6, 1)) / 6.f; // zero = -120dBFS
+ break;
+ default:
+ av_assert0(0);
+ }
+
+ return a;
+}
+
+static int plot_channel_lin(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ ShowSpectrumContext *s = ctx->priv;
+ const int h = s->orientation == VERTICAL ? s->channel_height : s->channel_width;
+ const int ch = jobnr;
+ float yf, uf, vf;
+ int y;
+
+ /* decide color range */
+ color_range(s, ch, &yf, &uf, &vf);
+
+ /* draw the channel */
+ for (y = 0; y < h; y++) {
+ int row = (s->mode == COMBINED) ? y : ch * h + y;
+ float *out = &s->color_buffer[ch][3 * row];
+ float a = get_value(ctx, ch, y);
+
+ pick_color(s, yf, uf, vf, a, out);
+ }
+
+ return 0;
+}
+
+static int plot_channel_log(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ ShowSpectrumContext *s = ctx->priv;
+ AVFilterLink *inlink = ctx->inputs[0];
+ const int h = s->orientation == VERTICAL ? s->channel_height : s->channel_width;
+ const int ch = jobnr;
+ float y, yf, uf, vf;
+ int yy = 0;
+
+ /* decide color range */
+ color_range(s, ch, &yf, &uf, &vf);
+
+ /* draw the channel */
+ for (y = 0; y < h && yy < h; yy++) {
+ float pos0 = bin_pos(yy+0, h, inlink->sample_rate);
+ float pos1 = bin_pos(yy+1, h, inlink->sample_rate);
+ float delta = pos1 - pos0;
+ float a0, a1;
+
+ a0 = get_value(ctx, ch, yy+0);
+ a1 = get_value(ctx, ch, FFMIN(yy+1, h-1));
+ for (float j = pos0; j < pos1 && y + j - pos0 < h; j++) {
+ float row = (s->mode == COMBINED) ? y + j - pos0 : ch * h + y + j - pos0;
+ float *out = &s->color_buffer[ch][3 * FFMIN(lrintf(row), h-1)];
+ float lerpfrac = (j - pos0) / delta;
+
+ pick_color(s, yf, uf, vf, lerpfrac * a1 + (1.f-lerpfrac) * a0, out);
+ }
+ y += delta;
+ }
+
+ return 0;
+}
+
static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@@ -820,6 +982,12 @@ static int config_output(AVFilterLink *outlink)
int i, fft_bits, h, w;
float overlap;
+ switch (s->fscale) {
+ case F_LINEAR: s->plot_channel = plot_channel_lin; break;
+ case F_LOG: s->plot_channel = plot_channel_log; break;
+ default: return AVERROR_BUG;
+ }
+
s->stop = FFMIN(s->stop, inlink->sample_rate / 2);
if (s->stop && s->stop <= s->start) {
av_log(ctx, AV_LOG_ERROR, "Stop frequency should be greater than start.\n");
@@ -960,7 +1128,7 @@ static int config_output(AVFilterLink *outlink)
generate_window_func(s->window_func_lut, s->win_size, s->win_func, &overlap);
if (s->overlap == 1)
s->overlap = overlap;
- s->hop_size = (1. - s->overlap) * s->win_size;
+ s->hop_size = (1.f - s->overlap) * s->win_size;
if (s->hop_size < 1) {
av_log(ctx, AV_LOG_ERROR, "overlap %f too big\n", s->overlap);
return AVERROR(EINVAL);
@@ -969,7 +1137,7 @@ static int config_output(AVFilterLink *outlink)
for (s->win_scale = 0, i = 0; i < s->win_size; i++) {
s->win_scale += s->window_func_lut[i] * s->window_func_lut[i];
}
- s->win_scale = 1. / sqrt(s->win_scale);
+ s->win_scale = 1.f / sqrtf(s->win_scale);
/* prepare the initial picref buffer (black frame) */
av_frame_free(&s->outpicref);
@@ -1030,8 +1198,8 @@ static int config_output(AVFilterLink *outlink)
#define RE(y, ch) s->fft_data[ch][y].re
#define IM(y, ch) s->fft_data[ch][y].im
-#define MAGNITUDE(y, ch) hypot(RE(y, ch), IM(y, ch))
-#define PHASE(y, ch) atan2(IM(y, ch), RE(y, ch))
+#define MAGNITUDE(y, ch) hypotf(RE(y, ch), IM(y, ch))
+#define PHASE(y, ch) atan2f(IM(y, ch), RE(y, ch))
static int calc_channel_magnitudes(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
@@ -1099,68 +1267,6 @@ static void clear_combine_buffer(ShowSpectrumContext *s, int size)
}
}
-static int plot_channel(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
-{
- ShowSpectrumContext *s = ctx->priv;
- const int h = s->orientation == VERTICAL ? s->channel_height : s->channel_width;
- const int ch = jobnr;
- float *magnitudes = s->magnitudes[ch];
- float *phases = s->phases[ch];
- float yf, uf, vf;
- int y;
-
- /* decide color range */
- color_range(s, ch, &yf, &uf, &vf);
-
- /* draw the channel */
- for (y = 0; y < h; y++) {
- int row = (s->mode == COMBINED) ? y : ch * h + y;
- float *out = &s->color_buffer[ch][3 * row];
- float a;
-
- switch (s->data) {
- case D_MAGNITUDE:
- /* get magnitude */
- a = magnitudes[y];
- break;
- case D_PHASE:
- /* get phase */
- a = phases[y];
- break;
- default:
- av_assert0(0);
- }
-
- /* apply scale */
- switch (s->scale) {
- case LINEAR:
- a = av_clipf(a, 0, 1);
- break;
- case SQRT:
- a = av_clipf(sqrt(a), 0, 1);
- break;
- case CBRT:
- a = av_clipf(cbrt(a), 0, 1);
- break;
- case FOURTHRT:
- a = av_clipf(sqrt(sqrt(a)), 0, 1);
- break;
- case FIFTHRT:
- a = av_clipf(pow(a, 0.20), 0, 1);
- break;
- case LOG:
- a = 1 + log10(av_clipd(a, 1e-6, 1)) / 6; // zero = -120dBFS
- break;
- default:
- av_assert0(0);
- }
-
- pick_color(s, yf, uf, vf, a, out);
- }
-
- return 0;
-}
-
static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
{
AVFilterContext *ctx = inlink->dst;
@@ -1173,7 +1279,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFrame *insamples)
/* initialize buffer for combining to black */
clear_combine_buffer(s, z);
- ctx->internal->execute(ctx, plot_channel, NULL, NULL, s->nb_display_channels);
+ ctx->internal->execute(ctx, s->plot_channel, NULL, NULL, s->nb_display_channels);
for (y = 0; y < z * 3; y++) {
for (x = 0; x < s->nb_display_channels; x++) {
@@ -1447,6 +1553,9 @@ static const AVOption showspectrumpic_options[] = {
{ "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=LOG}, 0, 0, FLAGS, "scale" },
{ "4thrt","4th root", 0, AV_OPT_TYPE_CONST, {.i64=FOURTHRT}, 0, 0, FLAGS, "scale" },
{ "5thrt","5th root", 0, AV_OPT_TYPE_CONST, {.i64=FIFTHRT}, 0, 0, FLAGS, "scale" },
+ { "fscale", "set frequency scale", OFFSET(fscale), AV_OPT_TYPE_INT, {.i64=F_LINEAR}, 0, NB_FSCALES-1, FLAGS, "fscale" },
+ { "lin", "linear", 0, AV_OPT_TYPE_CONST, {.i64=F_LINEAR}, 0, 0, FLAGS, "fscale" },
+ { "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=F_LOG}, 0, 0, FLAGS, "fscale" },
{ "saturation", "color saturation multiplier", OFFSET(saturation), AV_OPT_TYPE_FLOAT, {.dbl = 1}, -10, 10, FLAGS },
{ "win_func", "set window function", OFFSET(win_func), AV_OPT_TYPE_INT, {.i64 = WFUNC_HANNING}, 0, NB_WFUNC-1, FLAGS, "win_func" },
{ "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, FLAGS, "win_func" },
@@ -1530,7 +1639,7 @@ static int showspectrumpic_request_frame(AVFilterLink *outlink)
if (consumed >= spb) {
int h = s->orientation == VERTICAL ? s->h : s->w;
- scale_magnitudes(s, 1. / (consumed / spf));
+ scale_magnitudes(s, 1.f / (consumed / spf));
plot_spectrum_column(inlink, fin);
consumed = 0;
x++;
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c b/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c
index 6b553c4eba7..548d73c14f0 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showvolume.c
@@ -26,6 +26,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/xga_font_data.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
@@ -47,6 +48,7 @@ typedef struct ShowVolumeContext {
float bgopacity;
int mode;
+ int nb_samples;
AVFrame *out;
AVExpr *c_expr;
int draw_text;
@@ -162,12 +164,8 @@ static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
ShowVolumeContext *s = ctx->priv;
- int nb_samples;
- nb_samples = FFMAX(1024, ((double)inlink->sample_rate / av_q2d(s->frame_rate)) + 0.5);
- inlink->partial_buf_size =
- inlink->min_samples =
- inlink->max_samples = nb_samples;
+ s->nb_samples = FFMAX(1, av_rescale(inlink->sample_rate, s->frame_rate.den, s->frame_rate.num));
s->values = av_calloc(inlink->channels * VAR_VARS_NB, sizeof(double));
if (!s->values)
return AVERROR(ENOMEM);
@@ -449,6 +447,28 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
return ff_filter_frame(outlink, out);
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowVolumeContext *s = ctx->priv;
+ AVFrame *in = NULL;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold void uninit(AVFilterContext *ctx)
{
ShowVolumeContext *s = ctx->priv;
@@ -465,7 +485,6 @@ static const AVFilterPad showvolume_inputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_input,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -483,6 +502,7 @@ AVFilter ff_avf_showvolume = {
.name = "showvolume",
.description = NULL_IF_CONFIG_SMALL("Convert input audio volume to video output."),
.init = init,
+ .activate = activate,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowVolumeContext),
diff --git a/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c b/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
index 0e683cf42d1..afe05fb5040 100644
--- a/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
+++ b/chromium/third_party/ffmpeg/libavfilter/avf_showwaves.c
@@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
@@ -416,7 +417,7 @@ static int config_output(AVFilterLink *outlink)
showwaves->n = 1;
if (!showwaves->n)
- showwaves->n = FFMAX(1, ((double)inlink->sample_rate / (showwaves->w * av_q2d(showwaves->rate))) + 0.5);
+ showwaves->n = FFMAX(1, av_rescale_q(inlink->sample_rate, av_make_q(1, showwaves->w), showwaves->rate));
showwaves->buf_idx = 0;
if (!(showwaves->buf_idy = av_mallocz_array(nb_channels, sizeof(*showwaves->buf_idy)))) {
@@ -706,7 +707,8 @@ static int showwaves_filter_frame(AVFilterLink *inlink, AVFrame *insamples)
showwaves->sample_count_mod = 0;
showwaves->buf_idx++;
}
- if (showwaves->buf_idx == showwaves->w)
+ if (showwaves->buf_idx == showwaves->w ||
+ (ff_outlink_get_status(inlink) && i == nb_samples - 1))
if ((ret = push_frame(outlink)) < 0)
break;
outpicref = showwaves->outpicref;
@@ -717,11 +719,33 @@ end:
return ret;
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ ShowWavesContext *showwaves = ctx->priv;
+ AVFrame *in;
+ const int nb_samples = showwaves->n * outlink->w;
+ int ret;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_samples(inlink, nb_samples, nb_samples, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return showwaves_filter_frame(inlink, in);
+
+ FF_FILTER_FORWARD_STATUS(inlink, outlink);
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static const AVFilterPad showwaves_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
- .filter_frame = showwaves_filter_frame,
},
{ NULL }
};
@@ -731,7 +755,6 @@ static const AVFilterPad showwaves_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -744,6 +767,7 @@ AVFilter ff_avf_showwaves = {
.query_formats = query_formats,
.priv_size = sizeof(ShowWavesContext),
.inputs = showwaves_inputs,
+ .activate = activate,
.outputs = showwaves_outputs,
.priv_class = &showwaves_class,
};
@@ -765,6 +789,9 @@ static const AVOption showwavespic_options[] = {
{ "log", "logarithmic", 0, AV_OPT_TYPE_CONST, {.i64=SCALE_LOG}, .flags=FLAGS, .unit="scale"},
{ "sqrt", "square root", 0, AV_OPT_TYPE_CONST, {.i64=SCALE_SQRT}, .flags=FLAGS, .unit="scale"},
{ "cbrt", "cubic root", 0, AV_OPT_TYPE_CONST, {.i64=SCALE_CBRT}, .flags=FLAGS, .unit="scale"},
+ { "draw", "set draw mode", OFFSET(draw_mode), AV_OPT_TYPE_INT, {.i64 = DRAW_SCALE}, 0, DRAW_NB-1, FLAGS, .unit="draw" },
+ { "scale", "scale pixel values for each drawn sample", 0, AV_OPT_TYPE_CONST, {.i64=DRAW_SCALE}, .flags=FLAGS, .unit="draw"},
+ { "full", "draw every pixel for sample directly", 0, AV_OPT_TYPE_CONST, {.i64=DRAW_FULL}, .flags=FLAGS, .unit="draw"},
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.c b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.c
index 70d857f5f2e..82e900bd8c7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.c
+++ b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.c
@@ -24,8 +24,9 @@
*/
#include "dnn_backend_native.h"
+#include "libavutil/avassert.h"
-static DNNReturnType set_input_output_native(void *model, DNNData *input, DNNData *output)
+static DNNReturnType set_input_output_native(void *model, DNNInputData *input, const char *input_name, const char **output_names, uint32_t nb_output)
{
ConvolutionalNetwork *network = (ConvolutionalNetwork *)model;
InputParams *input_params;
@@ -45,6 +46,7 @@ static DNNReturnType set_input_output_native(void *model, DNNData *input, DNNDat
if (input->data){
av_freep(&input->data);
}
+ av_assert0(input->dt == DNN_FLOAT);
network->layers[0].output = input->data = av_malloc(cur_height * cur_width * cur_channels * sizeof(float));
if (!network->layers[0].output){
return DNN_ERROR;
@@ -59,6 +61,12 @@ static DNNReturnType set_input_output_native(void *model, DNNData *input, DNNDat
return DNN_ERROR;
}
cur_channels = conv_params->output_num;
+
+ if (conv_params->padding_method == VALID) {
+ int pad_size = (conv_params->kernel_size - 1) * conv_params->dilation;
+ cur_height -= pad_size;
+ cur_width -= pad_size;
+ }
break;
case DEPTH_TO_SPACE:
depth_to_space_params = (DepthToSpaceParams *)network->layers[layer].params;
@@ -75,17 +83,16 @@ static DNNReturnType set_input_output_native(void *model, DNNData *input, DNNDat
if (network->layers[layer].output){
av_freep(&network->layers[layer].output);
}
+
+ if (cur_height <= 0 || cur_width <= 0)
+ return DNN_ERROR;
+
network->layers[layer].output = av_malloc(cur_height * cur_width * cur_channels * sizeof(float));
if (!network->layers[layer].output){
return DNN_ERROR;
}
}
- output->data = network->layers[network->layers_num - 1].output;
- output->height = cur_height;
- output->width = cur_width;
- output->channels = cur_channels;
-
return DNN_SUCCESS;
}
@@ -157,13 +164,15 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename)
ff_dnn_free_model_native(&model);
return NULL;
}
+ conv_params->dilation = (int32_t)avio_rl32(model_file_context);
+ conv_params->padding_method = (int32_t)avio_rl32(model_file_context);
conv_params->activation = (int32_t)avio_rl32(model_file_context);
conv_params->input_num = (int32_t)avio_rl32(model_file_context);
conv_params->output_num = (int32_t)avio_rl32(model_file_context);
conv_params->kernel_size = (int32_t)avio_rl32(model_file_context);
kernel_size = conv_params->input_num * conv_params->output_num *
conv_params->kernel_size * conv_params->kernel_size;
- dnn_size += 16 + (kernel_size + conv_params->output_num << 2);
+ dnn_size += 24 + (kernel_size + conv_params->output_num << 2);
if (dnn_size > file_size || conv_params->input_num <= 0 ||
conv_params->output_num <= 0 || conv_params->kernel_size <= 0){
avio_closep(&model_file_context);
@@ -221,23 +230,35 @@ DNNModel *ff_dnn_load_model_native(const char *model_filename)
static void convolve(const float *input, float *output, const ConvolutionalParams *conv_params, int width, int height)
{
- int y, x, n_filter, ch, kernel_y, kernel_x;
int radius = conv_params->kernel_size >> 1;
int src_linesize = width * conv_params->input_num;
int filter_linesize = conv_params->kernel_size * conv_params->input_num;
int filter_size = conv_params->kernel_size * filter_linesize;
+ int pad_size = (conv_params->padding_method == VALID) ? (conv_params->kernel_size - 1) / 2 * conv_params->dilation : 0;
- for (y = 0; y < height; ++y){
- for (x = 0; x < width; ++x){
- for (n_filter = 0; n_filter < conv_params->output_num; ++n_filter){
+ for (int y = pad_size; y < height - pad_size; ++y) {
+ for (int x = pad_size; x < width - pad_size; ++x) {
+ for (int n_filter = 0; n_filter < conv_params->output_num; ++n_filter) {
output[n_filter] = conv_params->biases[n_filter];
- for (ch = 0; ch < conv_params->input_num; ++ch){
- for (kernel_y = 0; kernel_y < conv_params->kernel_size; ++kernel_y){
- for (kernel_x = 0; kernel_x < conv_params->kernel_size; ++kernel_x){
- output[n_filter] += input[CLAMP_TO_EDGE(y + kernel_y - radius, height) * src_linesize +
- CLAMP_TO_EDGE(x + kernel_x - radius, width) * conv_params->input_num + ch] *
- conv_params->kernel[n_filter * filter_size + kernel_y * filter_linesize +
- kernel_x * conv_params->input_num + ch];
+
+ for (int ch = 0; ch < conv_params->input_num; ++ch) {
+ for (int kernel_y = 0; kernel_y < conv_params->kernel_size; ++kernel_y) {
+ for (int kernel_x = 0; kernel_x < conv_params->kernel_size; ++kernel_x) {
+ float input_pel;
+ if (conv_params->padding_method == SAME_CLAMP_TO_EDGE) {
+ int y_pos = CLAMP_TO_EDGE(y + (kernel_y - radius) * conv_params->dilation, height);
+ int x_pos = CLAMP_TO_EDGE(x + (kernel_x - radius) * conv_params->dilation, width);
+ input_pel = input[y_pos * src_linesize + x_pos * conv_params->input_num + ch];
+ } else {
+ int y_pos = y + (kernel_y - radius) * conv_params->dilation;
+ int x_pos = x + (kernel_x - radius) * conv_params->dilation;
+ input_pel = (x_pos < 0 || x_pos >= width || y_pos < 0 || y_pos >= height) ? 0.0 :
+ input[y_pos * src_linesize + x_pos * conv_params->input_num + ch];
+ }
+
+
+ output[n_filter] += input_pel * conv_params->kernel[n_filter * filter_size + kernel_y * filter_linesize +
+ kernel_x * conv_params->input_num + ch];
}
}
}
@@ -250,6 +271,11 @@ static void convolve(const float *input, float *output, const ConvolutionalParam
break;
case SIGMOID:
output[n_filter] = 1.0f / (1.0f + exp(-output[n_filter]));
+ break;
+ case NONE:
+ break;
+ case LEAKY_RELU:
+ output[n_filter] = FFMAX(output[n_filter], 0.0) + 0.2 * FFMIN(output[n_filter], 0.0);
}
}
output += conv_params->output_num;
@@ -280,7 +306,7 @@ static void depth_to_space(const float *input, float *output, int block_size, in
}
}
-DNNReturnType ff_dnn_execute_model_native(const DNNModel *model)
+DNNReturnType ff_dnn_execute_model_native(const DNNModel *model, DNNData *outputs, uint32_t nb_output)
{
ConvolutionalNetwork *network = (ConvolutionalNetwork *)model->model;
int cur_width, cur_height, cur_channels;
@@ -308,6 +334,11 @@ DNNReturnType ff_dnn_execute_model_native(const DNNModel *model)
conv_params = (ConvolutionalParams *)network->layers[layer].params;
convolve(network->layers[layer - 1].output, network->layers[layer].output, conv_params, cur_width, cur_height);
cur_channels = conv_params->output_num;
+ if (conv_params->padding_method == VALID) {
+ int pad_size = (conv_params->kernel_size - 1) * conv_params->dilation;
+ cur_height -= pad_size;
+ cur_width -= pad_size;
+ }
break;
case DEPTH_TO_SPACE:
depth_to_space_params = (DepthToSpaceParams *)network->layers[layer].params;
@@ -322,6 +353,14 @@ DNNReturnType ff_dnn_execute_model_native(const DNNModel *model)
}
}
+ // native mode does not support multiple outputs yet
+ if (nb_output > 1)
+ return DNN_ERROR;
+ outputs[0].data = network->layers[network->layers_num - 1].output;
+ outputs[0].height = cur_height;
+ outputs[0].width = cur_width;
+ outputs[0].channels = cur_channels;
+
return DNN_SUCCESS;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.h b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.h
index 51d4cac9553..59179557336 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.h
+++ b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_native.h
@@ -32,7 +32,9 @@
typedef enum {INPUT, CONV, DEPTH_TO_SPACE} DNNLayerType;
-typedef enum {RELU, TANH, SIGMOID} DNNActivationFunc;
+typedef enum {RELU, TANH, SIGMOID, NONE, LEAKY_RELU} DNNActivationFunc;
+
+typedef enum {VALID, SAME, SAME_CLAMP_TO_EDGE} DNNConvPaddingParam;
typedef struct Layer{
DNNLayerType type;
@@ -43,6 +45,8 @@ typedef struct Layer{
typedef struct ConvolutionalParams{
int32_t input_num, output_num, kernel_size;
DNNActivationFunc activation;
+ DNNConvPaddingParam padding_method;
+ int32_t dilation;
float *kernel;
float *biases;
} ConvolutionalParams;
@@ -63,7 +67,7 @@ typedef struct ConvolutionalNetwork{
DNNModel *ff_dnn_load_model_native(const char *model_filename);
-DNNReturnType ff_dnn_execute_model_native(const DNNModel *model);
+DNNReturnType ff_dnn_execute_model_native(const DNNModel *model, DNNData *outputs, uint32_t nb_output);
void ff_dnn_free_model_native(DNNModel **model);
diff --git a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.c b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.c
index 5bc7f0684e3..ba959ae3a26 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.c
+++ b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.c
@@ -26,6 +26,7 @@
#include "dnn_backend_tf.h"
#include "dnn_backend_native.h"
#include "libavformat/avio.h"
+#include "libavutil/avassert.h"
#include <tensorflow/c/c_api.h>
@@ -33,9 +34,11 @@ typedef struct TFModel{
TF_Graph *graph;
TF_Session *session;
TF_Status *status;
- TF_Output input, output;
+ TF_Output input;
TF_Tensor *input_tensor;
- DNNData *output_data;
+ TF_Output *outputs;
+ TF_Tensor **output_tensors;
+ uint32_t nb_output;
} TFModel;
static void free_buffer(void *data, size_t length)
@@ -76,16 +79,36 @@ static TF_Buffer *read_graph(const char *model_filename)
return graph_buf;
}
-static DNNReturnType set_input_output_tf(void *model, DNNData *input, DNNData *output)
+static TF_Tensor *allocate_input_tensor(const DNNInputData *input)
{
- TFModel *tf_model = (TFModel *)model;
+ TF_DataType dt;
+ size_t size;
int64_t input_dims[] = {1, input->height, input->width, input->channels};
+ switch (input->dt) {
+ case DNN_FLOAT:
+ dt = TF_FLOAT;
+ size = sizeof(float);
+ break;
+ case DNN_UINT8:
+ dt = TF_UINT8;
+ size = sizeof(char);
+ break;
+ default:
+ av_assert0(!"should not reach here");
+ }
+
+ return TF_AllocateTensor(dt, input_dims, 4,
+ input_dims[1] * input_dims[2] * input_dims[3] * size);
+}
+
+static DNNReturnType set_input_output_tf(void *model, DNNInputData *input, const char *input_name, const char **output_names, uint32_t nb_output)
+{
+ TFModel *tf_model = (TFModel *)model;
TF_SessionOptions *sess_opts;
const TF_Operation *init_op = TF_GraphOperationByName(tf_model->graph, "init");
- TF_Tensor *output_tensor;
- // Input operation should be named 'x'
- tf_model->input.oper = TF_GraphOperationByName(tf_model->graph, "x");
+ // Input operation
+ tf_model->input.oper = TF_GraphOperationByName(tf_model->graph, input_name);
if (!tf_model->input.oper){
return DNN_ERROR;
}
@@ -93,19 +116,45 @@ static DNNReturnType set_input_output_tf(void *model, DNNData *input, DNNData *o
if (tf_model->input_tensor){
TF_DeleteTensor(tf_model->input_tensor);
}
- tf_model->input_tensor = TF_AllocateTensor(TF_FLOAT, input_dims, 4,
- input_dims[1] * input_dims[2] * input_dims[3] * sizeof(float));
+ tf_model->input_tensor = allocate_input_tensor(input);
if (!tf_model->input_tensor){
return DNN_ERROR;
}
input->data = (float *)TF_TensorData(tf_model->input_tensor);
- // Output operation should be named 'y'
- tf_model->output.oper = TF_GraphOperationByName(tf_model->graph, "y");
- if (!tf_model->output.oper){
+ // Output operation
+ if (nb_output == 0)
+ return DNN_ERROR;
+
+ av_freep(&tf_model->outputs);
+ tf_model->outputs = av_malloc_array(nb_output, sizeof(*tf_model->outputs));
+ if (!tf_model->outputs)
return DNN_ERROR;
+ for (int i = 0; i < nb_output; ++i) {
+ tf_model->outputs[i].oper = TF_GraphOperationByName(tf_model->graph, output_names[i]);
+ if (!tf_model->outputs[i].oper){
+ av_freep(&tf_model->outputs);
+ return DNN_ERROR;
+ }
+ tf_model->outputs[i].index = 0;
}
- tf_model->output.index = 0;
+
+ if (tf_model->output_tensors) {
+ for (uint32_t i = 0; i < tf_model->nb_output; ++i) {
+ if (tf_model->output_tensors[i]) {
+ TF_DeleteTensor(tf_model->output_tensors[i]);
+ tf_model->output_tensors[i] = NULL;
+ }
+ }
+ }
+ av_freep(&tf_model->output_tensors);
+ tf_model->output_tensors = av_mallocz_array(nb_output, sizeof(*tf_model->output_tensors));
+ if (!tf_model->output_tensors) {
+ av_freep(&tf_model->outputs);
+ return DNN_ERROR;
+ }
+
+ tf_model->nb_output = nb_output;
if (tf_model->session){
TF_CloseSession(tf_model->session, tf_model->status);
@@ -132,26 +181,6 @@ static DNNReturnType set_input_output_tf(void *model, DNNData *input, DNNData *o
}
}
- // Execute network to get output height, width and number of channels
- TF_SessionRun(tf_model->session, NULL,
- &tf_model->input, &tf_model->input_tensor, 1,
- &tf_model->output, &output_tensor, 1,
- NULL, 0, NULL, tf_model->status);
- if (TF_GetCode(tf_model->status) != TF_OK){
- return DNN_ERROR;
- }
- else{
- output->height = TF_Dim(output_tensor, 1);
- output->width = TF_Dim(output_tensor, 2);
- output->channels = TF_Dim(output_tensor, 3);
- output->data = av_malloc(output->height * output->width * output->channels * sizeof(float));
- if (!output->data){
- return DNN_ERROR;
- }
- tf_model->output_data = output;
- TF_DeleteTensor(output_tensor);
- }
-
return DNN_SUCCESS;
}
@@ -440,6 +469,7 @@ static DNNReturnType load_native_model(TFModel *tf_model, const char *model_file
for (layer = 0; layer < conv_network->layers_num; ++layer){
switch (conv_network->layers[layer].type){
case INPUT:
+ layer_add_res = DNN_SUCCESS;
break;
case CONV:
layer_add_res = add_conv_layer(tf_model, transpose_op, &op,
@@ -481,14 +511,11 @@ DNNModel *ff_dnn_load_model_tf(const char *model_filename)
return NULL;
}
- tf_model = av_malloc(sizeof(TFModel));
+ tf_model = av_mallocz(sizeof(TFModel));
if (!tf_model){
av_freep(&model);
return NULL;
}
- tf_model->session = NULL;
- tf_model->input_tensor = NULL;
- tf_model->output_data = NULL;
if (load_tf_model(tf_model, model_filename) != DNN_SUCCESS){
if (load_native_model(tf_model, model_filename) != DNN_SUCCESS){
@@ -507,27 +534,38 @@ DNNModel *ff_dnn_load_model_tf(const char *model_filename)
-DNNReturnType ff_dnn_execute_model_tf(const DNNModel *model)
+DNNReturnType ff_dnn_execute_model_tf(const DNNModel *model, DNNData *outputs, uint32_t nb_output)
{
TFModel *tf_model = (TFModel *)model->model;
- TF_Tensor *output_tensor;
+ uint32_t nb = FFMIN(nb_output, tf_model->nb_output);
+ if (nb == 0)
+ return DNN_ERROR;
+
+ av_assert0(tf_model->output_tensors);
+ for (uint32_t i = 0; i < tf_model->nb_output; ++i) {
+ if (tf_model->output_tensors[i]) {
+ TF_DeleteTensor(tf_model->output_tensors[i]);
+ tf_model->output_tensors[i] = NULL;
+ }
+ }
TF_SessionRun(tf_model->session, NULL,
&tf_model->input, &tf_model->input_tensor, 1,
- &tf_model->output, &output_tensor, 1,
+ tf_model->outputs, tf_model->output_tensors, nb,
NULL, 0, NULL, tf_model->status);
if (TF_GetCode(tf_model->status) != TF_OK){
return DNN_ERROR;
}
- else{
- memcpy(tf_model->output_data->data, TF_TensorData(output_tensor),
- tf_model->output_data->height * tf_model->output_data->width *
- tf_model->output_data->channels * sizeof(float));
- TF_DeleteTensor(output_tensor);
- return DNN_SUCCESS;
+ for (uint32_t i = 0; i < nb; ++i) {
+ outputs[i].height = TF_Dim(tf_model->output_tensors[i], 1);
+ outputs[i].width = TF_Dim(tf_model->output_tensors[i], 2);
+ outputs[i].channels = TF_Dim(tf_model->output_tensors[i], 3);
+ outputs[i].data = TF_TensorData(tf_model->output_tensors[i]);
}
+
+ return DNN_SUCCESS;
}
void ff_dnn_free_model_tf(DNNModel **model)
@@ -549,9 +587,16 @@ void ff_dnn_free_model_tf(DNNModel **model)
if (tf_model->input_tensor){
TF_DeleteTensor(tf_model->input_tensor);
}
- if (tf_model->output_data){
- av_freep(&tf_model->output_data->data);
+ if (tf_model->output_tensors) {
+ for (uint32_t i = 0; i < tf_model->nb_output; ++i) {
+ if (tf_model->output_tensors[i]) {
+ TF_DeleteTensor(tf_model->output_tensors[i]);
+ tf_model->output_tensors[i] = NULL;
+ }
+ }
}
+ av_freep(&tf_model->outputs);
+ av_freep(&tf_model->output_tensors);
av_freep(&tf_model);
av_freep(model);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.h b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.h
index 7ba84f40ee3..07877b1209d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.h
+++ b/chromium/third_party/ffmpeg/libavfilter/dnn_backend_tf.h
@@ -31,7 +31,7 @@
DNNModel *ff_dnn_load_model_tf(const char *model_filename);
-DNNReturnType ff_dnn_execute_model_tf(const DNNModel *model);
+DNNReturnType ff_dnn_execute_model_tf(const DNNModel *model, DNNData *outputs, uint32_t nb_output);
void ff_dnn_free_model_tf(DNNModel **model);
diff --git a/chromium/third_party/ffmpeg/libavfilter/dnn_interface.h b/chromium/third_party/ffmpeg/libavfilter/dnn_interface.h
index e3673438b6a..c24df0e9617 100644
--- a/chromium/third_party/ffmpeg/libavfilter/dnn_interface.h
+++ b/chromium/third_party/ffmpeg/libavfilter/dnn_interface.h
@@ -26,10 +26,20 @@
#ifndef AVFILTER_DNN_INTERFACE_H
#define AVFILTER_DNN_INTERFACE_H
+#include <stdint.h>
+
typedef enum {DNN_SUCCESS, DNN_ERROR} DNNReturnType;
typedef enum {DNN_NATIVE, DNN_TF} DNNBackendType;
+typedef enum {DNN_FLOAT, DNN_UINT8} DNNDataType;
+
+typedef struct DNNInputData{
+ void *data;
+ DNNDataType dt;
+ int width, height, channels;
+} DNNInputData;
+
typedef struct DNNData{
float *data;
int width, height, channels;
@@ -38,9 +48,9 @@ typedef struct DNNData{
typedef struct DNNModel{
// Stores model that can be different for different backends.
void *model;
- // Sets model input and output, while allocating additional memory for intermediate calculations.
+ // Sets model input and output.
// Should be called at least once before model execution.
- DNNReturnType (*set_input_output)(void *model, DNNData *input, DNNData *output);
+ DNNReturnType (*set_input_output)(void *model, DNNInputData *input, const char *input_name, const char **output_names, uint32_t nb_output);
} DNNModel;
// Stores pointers to functions for loading, executing, freeing DNN models for one of the backends.
@@ -48,7 +58,7 @@ typedef struct DNNModule{
// Loads model and parameters from given file. Returns NULL if it is not possible.
DNNModel *(*load_model)(const char *model_filename);
// Executes model with specified input and output. Returns DNN_ERROR otherwise.
- DNNReturnType (*execute_model)(const DNNModel *model);
+ DNNReturnType (*execute_model)(const DNNModel *model, DNNData *outputs, uint32_t nb_output);
// Frees memory allocated for model.
void (*free_model)(DNNModel **model);
} DNNModule;
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
index f613d8def23..f25d5f096e5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_ebur128.c
@@ -420,7 +420,7 @@ static int config_audio_output(AVFilterLink *outlink)
for (i = 0; i < nb_channels; i++) {
/* channel weighting */
- const uint16_t chl = av_channel_layout_extract_channel(outlink->channel_layout, i);
+ const uint64_t chl = av_channel_layout_extract_channel(outlink->channel_layout, i);
if (chl & (AV_CH_LOW_FREQUENCY|AV_CH_LOW_FREQUENCY_2)) {
ebur128->ch_weighting[i] = 0;
} else if (chl & BACK_MASK) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_interleave.c b/chromium/third_party/ffmpeg/libavfilter/f_interleave.c
index d8a73b52e5d..06f4cda7985 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_interleave.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_interleave.c
@@ -27,12 +27,9 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
-#define FF_INTERNAL_FIELDS 1
-#include "framequeue.h"
-
#include "avfilter.h"
-#include "bufferqueue.h"
#include "formats.h"
+#include "filters.h"
#include "internal.h"
#include "audio.h"
#include "video.h"
@@ -40,7 +37,7 @@
typedef struct InterleaveContext {
const AVClass *class;
int nb_inputs;
- struct FFBufQueue *queues;
+ int64_t pts;
} InterleaveContext;
#define OFFSET(x) offsetof(InterleaveContext, x)
@@ -52,58 +49,78 @@ static const AVOption filt_name##_options[] = { \
{ NULL } \
}
-inline static int push_frame(AVFilterContext *ctx)
+static int activate(AVFilterContext *ctx)
{
+ AVFilterLink *outlink = ctx->outputs[0];
InterleaveContext *s = ctx->priv;
- AVFrame *frame;
- int i, queue_idx = -1;
- int64_t pts_min = INT64_MAX;
+ int64_t q_pts, pts = INT64_MAX;
+ int i, nb_eofs = 0, input_idx = -1;
+
+ FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, ctx);
- /* look for oldest frame */
for (i = 0; i < ctx->nb_inputs; i++) {
- struct FFBufQueue *q = &s->queues[i];
+ if (!ff_outlink_get_status(ctx->inputs[i]) &&
+ !ff_inlink_queued_frames(ctx->inputs[i]))
+ break;
+ }
- if (!q->available && !ctx->inputs[i]->status_out)
- return 0;
- if (q->available) {
- frame = ff_bufqueue_peek(q, 0);
- if (frame->pts < pts_min) {
- pts_min = frame->pts;
- queue_idx = i;
+ if (i == ctx->nb_inputs) {
+ for (i = 0; i < ctx->nb_inputs; i++) {
+ AVFrame *frame;
+
+ if (ff_outlink_get_status(ctx->inputs[i]))
+ continue;
+
+ frame = ff_inlink_peek_frame(ctx->inputs[i], 0);
+ if (frame->pts == AV_NOPTS_VALUE) {
+ int ret;
+
+ av_log(ctx, AV_LOG_WARNING,
+ "NOPTS value for input frame cannot be accepted, frame discarded\n");
+ ret = ff_inlink_consume_frame(ctx->inputs[i], &frame);
+ if (ret < 0)
+ return ret;
+ av_frame_free(&frame);
+ return AVERROR_INVALIDDATA;
+ }
+
+ q_pts = av_rescale_q(frame->pts, ctx->inputs[i]->time_base, AV_TIME_BASE_Q);
+ if (q_pts < pts) {
+ pts = q_pts;
+ input_idx = i;
}
}
- }
- /* all inputs are closed */
- if (queue_idx < 0)
- return AVERROR_EOF;
+ if (input_idx >= 0) {
+ AVFrame *frame;
+ int ret;
- frame = ff_bufqueue_get(&s->queues[queue_idx]);
- av_log(ctx, AV_LOG_DEBUG, "queue:%d -> frame time:%f\n",
- queue_idx, frame->pts * av_q2d(AV_TIME_BASE_Q));
- return ff_filter_frame(ctx->outputs[0], frame);
-}
+ ret = ff_inlink_consume_frame(ctx->inputs[input_idx], &frame);
+ if (ret < 0)
+ return ret;
-static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
-{
- AVFilterContext *ctx = inlink->dst;
- InterleaveContext *s = ctx->priv;
- unsigned in_no = FF_INLINK_IDX(inlink);
+ frame->pts = s->pts = pts;
+ return ff_filter_frame(outlink, frame);
+ }
+ }
- if (frame->pts == AV_NOPTS_VALUE) {
- av_log(ctx, AV_LOG_WARNING,
- "NOPTS value for input frame cannot be accepted, frame discarded\n");
- av_frame_free(&frame);
- return AVERROR_INVALIDDATA;
+ for (i = 0; i < ctx->nb_inputs; i++) {
+ if (ff_inlink_queued_frames(ctx->inputs[i]))
+ continue;
+ if (ff_outlink_frame_wanted(outlink) &&
+ !ff_outlink_get_status(ctx->inputs[i])) {
+ ff_inlink_request_frame(ctx->inputs[i]);
+ return 0;
+ }
+ nb_eofs++;
}
- /* queue frame */
- frame->pts = av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q);
- av_log(ctx, AV_LOG_DEBUG, "frame pts:%f -> queue idx:%d available:%d\n",
- frame->pts * av_q2d(AV_TIME_BASE_Q), in_no, s->queues[in_no].available);
- ff_bufqueue_add(ctx, &s->queues[in_no], frame);
+ if (nb_eofs == ctx->nb_inputs) {
+ ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
+ return 0;
+ }
- return push_frame(ctx);
+ return FFERROR_NOT_READY;
}
static av_cold int init(AVFilterContext *ctx)
@@ -112,10 +129,6 @@ static av_cold int init(AVFilterContext *ctx)
const AVFilterPad *outpad = &ctx->filter->outputs[0];
int i, ret;
- s->queues = av_calloc(s->nb_inputs, sizeof(s->queues[0]));
- if (!s->queues)
- return AVERROR(ENOMEM);
-
for (i = 0; i < s->nb_inputs; i++) {
AVFilterPad inpad = { 0 };
@@ -123,7 +136,6 @@ static av_cold int init(AVFilterContext *ctx)
if (!inpad.name)
return AVERROR(ENOMEM);
inpad.type = outpad->type;
- inpad.filter_frame = filter_frame;
switch (outpad->type) {
case AVMEDIA_TYPE_VIDEO:
@@ -144,14 +156,8 @@ static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)
{
- InterleaveContext *s = ctx->priv;
- int i;
-
- for (i = 0; i < ctx->nb_inputs; i++) {
- ff_bufqueue_discard_all(&s->queues[i]);
- av_freep(&s->queues[i]);
+ for (int i = 0; i < ctx->nb_inputs; i++)
av_freep(&ctx->input_pads[i].name);
- }
}
static int config_output(AVFilterLink *outlink)
@@ -190,23 +196,6 @@ static int config_output(AVFilterLink *outlink)
return 0;
}
-static int request_frame(AVFilterLink *outlink)
-{
- AVFilterContext *ctx = outlink->src;
- InterleaveContext *s = ctx->priv;
- int i, ret;
-
- for (i = 0; i < ctx->nb_inputs; i++) {
- if (!s->queues[i].available && !ctx->inputs[i]->status_out) {
- ret = ff_request_frame(ctx->inputs[i]);
- if (ret != AVERROR_EOF)
- return ret;
- }
- }
-
- return push_frame(ctx);
-}
-
#if CONFIG_INTERLEAVE_FILTER
DEFINE_OPTIONS(interleave, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM);
@@ -217,7 +206,6 @@ static const AVFilterPad interleave_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -228,6 +216,7 @@ AVFilter ff_vf_interleave = {
.priv_size = sizeof(InterleaveContext),
.init = init,
.uninit = uninit,
+ .activate = activate,
.outputs = interleave_outputs,
.priv_class = &interleave_class,
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS,
@@ -245,7 +234,6 @@ static const AVFilterPad ainterleave_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_AUDIO,
.config_props = config_output,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -256,6 +244,7 @@ AVFilter ff_af_ainterleave = {
.priv_size = sizeof(InterleaveContext),
.init = init,
.uninit = uninit,
+ .activate = activate,
.outputs = ainterleave_outputs,
.priv_class = &ainterleave_class,
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS,
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_loop.c b/chromium/third_party/ffmpeg/libavfilter/f_loop.c
index d9d55f98372..5ec44d9da2e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_loop.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_loop.c
@@ -55,6 +55,15 @@ typedef struct LoopContext {
#define VFLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
#define OFFSET(x) offsetof(LoopContext, x)
+static void check_size(AVFilterContext *ctx)
+{
+ LoopContext *s = ctx->priv;
+
+ if (!s->size)
+ av_log(ctx, AV_LOG_WARNING, "Number of %s to loop is not set!\n",
+ ctx->input_pads[0].type == AVMEDIA_TYPE_VIDEO ? "frames" : "samples");
+}
+
#if CONFIG_ALOOP_FILTER
static int aconfig_input(AVFilterLink *inlink)
@@ -67,6 +76,8 @@ static int aconfig_input(AVFilterLink *inlink)
if (!s->fifo || !s->left)
return AVERROR(ENOMEM);
+ check_size(ctx);
+
return 0;
}
@@ -250,6 +261,8 @@ static av_cold int init(AVFilterContext *ctx)
if (!s->frames)
return AVERROR(ENOMEM);
+ check_size(ctx);
+
return 0;
}
@@ -343,7 +356,7 @@ static int activate(AVFilterContext *ctx)
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
- if (!s->eof && (s->nb_frames < s->size || !s->loop)) {
+ if (!s->eof && (s->nb_frames < s->size || !s->loop || !s->size)) {
ret = ff_inlink_consume_frame(inlink, &frame);
if (ret < 0)
return ret;
@@ -352,11 +365,13 @@ static int activate(AVFilterContext *ctx)
}
if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) {
- if (status == AVERROR_EOF)
+ if (status == AVERROR_EOF) {
+ s->size = s->nb_frames;
s->eof = 1;
+ }
}
- if (s->eof && (s->loop == 0 || s->nb_frames < s->size)) {
+ if (s->eof && (!s->loop || !s->size)) {
ff_outlink_set_status(outlink, AVERROR_EOF, s->duration);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/f_realtime.c b/chromium/third_party/ffmpeg/libavfilter/f_realtime.c
index 171c16aaaa3..6fd3559dac9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/f_realtime.c
+++ b/chromium/third_party/ffmpeg/libavfilter/f_realtime.c
@@ -22,11 +22,13 @@
#include "libavutil/time.h"
#include "avfilter.h"
#include "internal.h"
+#include <float.h>
typedef struct RealtimeContext {
const AVClass *class;
int64_t delta;
int64_t limit;
+ double speed;
unsigned inited;
} RealtimeContext;
@@ -36,7 +38,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
RealtimeContext *s = ctx->priv;
if (frame->pts != AV_NOPTS_VALUE) {
- int64_t pts = av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q);
+ int64_t pts = av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q) / s->speed;
int64_t now = av_gettime_relative();
int64_t sleep = pts - now + s->delta;
if (!s->inited) {
@@ -44,7 +46,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
sleep = 0;
s->delta = now - pts;
}
- if (sleep > s->limit || sleep < -s->limit) {
+ if (FFABS(sleep) > s->limit / s->speed) {
av_log(ctx, AV_LOG_WARNING,
"time discontinuity detected: %"PRIi64" us, resetting\n",
sleep);
@@ -65,6 +67,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
static const AVOption options[] = {
{ "limit", "sleep time limit", OFFSET(limit), AV_OPT_TYPE_DURATION, { .i64 = 2000000 }, 0, INT64_MAX, FLAGS },
+ { "speed", "speed factor", OFFSET(speed), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, DBL_MIN, DBL_MAX, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/framesync.c b/chromium/third_party/ffmpeg/libavfilter/framesync.c
index 22d3f091a3f..bc95f7d9048 100644
--- a/chromium/third_party/ffmpeg/libavfilter/framesync.c
+++ b/chromium/third_party/ffmpeg/libavfilter/framesync.c
@@ -127,16 +127,16 @@ int ff_framesync_configure(FFFrameSync *fs)
fs->opt_shortest = 1;
fs->opt_eof_action = EOF_ACTION_ENDALL;
}
- if (fs->opt_shortest) {
- for (i = 0; i < fs->nb_in; i++)
- fs->in[i].after = EXT_STOP;
- }
if (!fs->opt_repeatlast) {
for (i = 1; i < fs->nb_in; i++) {
fs->in[i].after = EXT_NULL;
fs->in[i].sync = 0;
}
}
+ if (fs->opt_shortest) {
+ for (i = 0; i < fs->nb_in; i++)
+ fs->in[i].after = EXT_STOP;
+ }
if (!fs->time_base.num) {
for (i = 0; i < fs->nb_in; i++) {
diff --git a/chromium/third_party/ffmpeg/libavfilter/gblur.h b/chromium/third_party/ffmpeg/libavfilter/gblur.h
new file mode 100644
index 00000000000..87129801dea
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/gblur.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011 Pascal Getreuer
+ * Copyright (c) 2016 Paul B Mahol
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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 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.
+ */
+
+#ifndef AVFILTER_GBLUR_H
+#define AVFILTER_GBLUR_H
+#include "avfilter.h"
+
+typedef struct GBlurContext {
+ const AVClass *class;
+
+ float sigma;
+ float sigmaV;
+ int steps;
+ int planes;
+
+ int depth;
+ int planewidth[4];
+ int planeheight[4];
+ float *buffer;
+ float boundaryscale;
+ float boundaryscaleV;
+ float postscale;
+ float postscaleV;
+ float nu;
+ float nuV;
+ int nb_planes;
+ void (*horiz_slice)(float *buffer, int width, int height, int steps, float nu, float bscale);
+} GBlurContext;
+void ff_gblur_init(GBlurContext *s);
+void ff_gblur_init_x86(GBlurContext *s);
+#endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/opencl.h b/chromium/third_party/ffmpeg/libavfilter/opencl.h
index 0b06232ade5..973b6d82dd4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/opencl.h
+++ b/chromium/third_party/ffmpeg/libavfilter/opencl.h
@@ -73,6 +73,44 @@ typedef struct OpenCLFilterContext {
goto fail; \
} \
} while(0)
+/**
+ * release an OpenCL Kernel
+ */
+#define CL_RELEASE_KERNEL(k) \
+do { \
+ if (k) { \
+ cle = clReleaseKernel(k); \
+ if (cle != CL_SUCCESS) \
+ av_log(avctx, AV_LOG_ERROR, "Failed to release " \
+ "OpenCL kernel: %d.\n", cle); \
+ } \
+} while(0)
+
+/**
+ * release an OpenCL Memory Object
+ */
+#define CL_RELEASE_MEMORY(m) \
+do { \
+ if (m) { \
+ cle = clReleaseMemObject(m); \
+ if (cle != CL_SUCCESS) \
+ av_log(avctx, AV_LOG_ERROR, "Failed to release " \
+ "OpenCL memory: %d.\n", cle); \
+ } \
+} while(0)
+
+/**
+ * release an OpenCL Command Queue
+ */
+#define CL_RELEASE_QUEUE(q) \
+do { \
+ if (q) { \
+ cle = clReleaseCommandQueue(q); \
+ if (cle != CL_SUCCESS) \
+ av_log(avctx, AV_LOG_ERROR, "Failed to release " \
+ "OpenCL command queue: %d.\n", cle); \
+ } \
+} while(0)
/**
* Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
diff --git a/chromium/third_party/ffmpeg/libavfilter/opencl/nlmeans.cl b/chromium/third_party/ffmpeg/libavfilter/opencl/nlmeans.cl
new file mode 100644
index 00000000000..72bd681fd60
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/opencl/nlmeans.cl
@@ -0,0 +1,115 @@
+/*
+ * 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
+ */
+
+const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
+ CLK_ADDRESS_CLAMP_TO_EDGE |
+ CLK_FILTER_NEAREST);
+
+kernel void horiz_sum(__global uint4 *integral_img,
+ __read_only image2d_t src,
+ int width,
+ int height,
+ int4 dx,
+ int4 dy)
+{
+
+ int y = get_global_id(0);
+ int work_size = get_global_size(0);
+
+ uint4 sum = (uint4)(0);
+ float4 s2;
+ for (int i = 0; i < width; i++) {
+ float s1 = read_imagef(src, sampler, (int2)(i, y)).x;
+ s2.x = read_imagef(src, sampler, (int2)(i + dx.x, y + dy.x)).x;
+ s2.y = read_imagef(src, sampler, (int2)(i + dx.y, y + dy.y)).x;
+ s2.z = read_imagef(src, sampler, (int2)(i + dx.z, y + dy.z)).x;
+ s2.w = read_imagef(src, sampler, (int2)(i + dx.w, y + dy.w)).x;
+ sum += convert_uint4((s1 - s2) * (s1 - s2) * 255 * 255);
+ integral_img[y * width + i] = sum;
+ }
+}
+
+kernel void vert_sum(__global uint4 *integral_img,
+ __global int *overflow,
+ int width,
+ int height)
+{
+ int x = get_global_id(0);
+ uint4 sum = 0;
+ for (int i = 0; i < height; i++) {
+ if (any((uint4)UINT_MAX - integral_img[i * width + x] < sum))
+ atomic_inc(overflow);
+ integral_img[i * width + x] += sum;
+ sum = integral_img[i * width + x];
+ }
+}
+
+kernel void weight_accum(global float *sum, global float *weight,
+ global uint4 *integral_img, __read_only image2d_t src,
+ int width, int height, int p, float h,
+ int4 dx, int4 dy)
+{
+ // w(x) = integral_img(x-p, y-p) +
+ // integral_img(x+p, y+p) -
+ // integral_img(x+p, y-p) -
+ // integral_img(x-p, y+p)
+ // total_sum[x] += w(x, y) * src(x + dx, y + dy)
+ // total_weight += w(x, y)
+
+ int x = get_global_id(0);
+ int y = get_global_id(1);
+ int4 xoff = x + dx;
+ int4 yoff = y + dy;
+ uint4 a = 0, b = 0, c = 0, d = 0;
+ uint4 src_pix = 0;
+
+ // out-of-bounding-box?
+ int oobb = (x - p) < 0 || (y - p) < 0 || (y + p) >= height || (x + p) >= width;
+
+ src_pix.x = (int)(255 * read_imagef(src, sampler, (int2)(xoff.x, yoff.x)).x);
+ src_pix.y = (int)(255 * read_imagef(src, sampler, (int2)(xoff.y, yoff.y)).x);
+ src_pix.z = (int)(255 * read_imagef(src, sampler, (int2)(xoff.z, yoff.z)).x);
+ src_pix.w = (int)(255 * read_imagef(src, sampler, (int2)(xoff.w, yoff.w)).x);
+ if (!oobb) {
+ a = integral_img[(y - p) * width + x - p];
+ b = integral_img[(y + p) * width + x - p];
+ c = integral_img[(y - p) * width + x + p];
+ d = integral_img[(y + p) * width + x + p];
+ }
+
+ float4 patch_diff = convert_float4(d + a - c - b);
+ float4 w = native_exp(-patch_diff / (h * h));
+ float w_sum = w.x + w.y + w.z + w.w;
+ weight[y * width + x] += w_sum;
+ sum[y * width + x] += dot(w, convert_float4(src_pix));
+}
+
+kernel void average(__write_only image2d_t dst,
+ __read_only image2d_t src,
+ global float *sum, global float *weight) {
+ int x = get_global_id(0);
+ int y = get_global_id(1);
+ int2 dim = get_image_dim(dst);
+
+ float w = weight[y * dim.x + x];
+ float s = sum[y * dim.x + x];
+ float src_pix = read_imagef(src, sampler, (int2)(x, y)).x;
+ float r = (s + src_pix * 255) / (1.0f + w) / 255.0f;
+ if (x < dim.x && y < dim.y)
+ write_imagef(dst, (int2)(x, y), (float4)(r, 0.0f, 0.0f, 1.0f));
+}
diff --git a/chromium/third_party/ffmpeg/libavfilter/opencl_source.h b/chromium/third_party/ffmpeg/libavfilter/opencl_source.h
index 51f7178cf2f..1a6cd7ca7a8 100644
--- a/chromium/third_party/ffmpeg/libavfilter/opencl_source.h
+++ b/chromium/third_party/ffmpeg/libavfilter/opencl_source.h
@@ -24,6 +24,7 @@ extern const char *ff_opencl_source_colorkey;
extern const char *ff_opencl_source_colorspace_common;
extern const char *ff_opencl_source_convolution;
extern const char *ff_opencl_source_neighbor;
+extern const char *ff_opencl_source_nlmeans;
extern const char *ff_opencl_source_overlay;
extern const char *ff_opencl_source_tonemap;
extern const char *ff_opencl_source_transpose;
diff --git a/chromium/third_party/ffmpeg/libavfilter/qsvvpp.c b/chromium/third_party/ffmpeg/libavfilter/qsvvpp.c
index 06efdf50891..8d5ff2eb653 100644
--- a/chromium/third_party/ffmpeg/libavfilter/qsvvpp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/qsvvpp.c
@@ -153,6 +153,7 @@ static int map_frame_to_surface(AVFrame *frame, mfxFrameSurface1 *surface)
{
switch (frame->format) {
case AV_PIX_FMT_NV12:
+ case AV_PIX_FMT_P010:
surface->Data.Y = frame->data[0];
surface->Data.UV = frame->data[1];
break;
@@ -316,7 +317,6 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p
}
av_frame_copy_props(qsv_frame->frame, picref);
- av_frame_free(&picref);
} else
qsv_frame->frame = av_frame_clone(picref);
@@ -461,6 +461,8 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
out_frames_ctx->height = FFALIGN(outlink->h, 32);
out_frames_ctx->sw_format = s->out_sw_format;
out_frames_ctx->initial_pool_size = 64;
+ if (avctx->extra_hw_frames > 0)
+ out_frames_ctx->initial_pool_size += avctx->extra_hw_frames;
out_frames_hwctx->frame_type = s->out_mem_mode;
ret = av_hwframe_ctx_init(out_frames_ref);
diff --git a/chromium/third_party/ffmpeg/libavfilter/unsharp.h b/chromium/third_party/ffmpeg/libavfilter/unsharp.h
index caff986fc1b..a60b30f31a8 100644
--- a/chromium/third_party/ffmpeg/libavfilter/unsharp.h
+++ b/chromium/third_party/ffmpeg/libavfilter/unsharp.h
@@ -37,7 +37,8 @@ typedef struct UnsharpFilterParam {
int steps_y; ///< vertical step count
int scalebits; ///< bits to shift pixel
int32_t halfscale; ///< amount to add to pixel
- uint32_t *sc[MAX_MATRIX_SIZE - 1]; ///< finite state machine storage
+ uint32_t *sr; ///< finite state machine storage within a row
+ uint32_t **sc; ///< finite state machine storage across rows
} UnsharpFilterParam;
typedef struct UnsharpContext {
@@ -47,6 +48,7 @@ typedef struct UnsharpContext {
UnsharpFilterParam luma; ///< luma parameters (width, height, amount)
UnsharpFilterParam chroma; ///< chroma parameters (width, height, amount)
int hsub, vsub;
+ int nb_threads;
int opencl;
int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out);
} UnsharpContext;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.c b/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.c
index c5bbc3b85b9..b5b245c8afe 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.c
@@ -234,18 +234,330 @@ fail:
return err;
}
-int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs)
+typedef struct VAAPIColourProperties {
+ VAProcColorStandardType va_color_standard;
+
+ enum AVColorPrimaries color_primaries;
+ enum AVColorTransferCharacteristic color_trc;
+ enum AVColorSpace colorspace;
+
+ uint8_t va_chroma_sample_location;
+ uint8_t va_color_range;
+
+ enum AVColorRange color_range;
+ enum AVChromaLocation chroma_sample_location;
+} VAAPIColourProperties;
+
+static const VAAPIColourProperties vaapi_colour_standard_map[] = {
+ { VAProcColorStandardBT601, 5, 6, 5 },
+ { VAProcColorStandardBT601, 6, 6, 6 },
+ { VAProcColorStandardBT709, 1, 1, 1 },
+ { VAProcColorStandardBT470M, 4, 4, 4 },
+ { VAProcColorStandardBT470BG, 5, 5, 5 },
+ { VAProcColorStandardSMPTE170M, 6, 6, 6 },
+ { VAProcColorStandardSMPTE240M, 7, 7, 7 },
+ { VAProcColorStandardGenericFilm, 8, 1, 1 },
+#if VA_CHECK_VERSION(1, 1, 0)
+ { VAProcColorStandardSRGB, 1, 13, 0 },
+ { VAProcColorStandardXVYCC601, 1, 11, 5 },
+ { VAProcColorStandardXVYCC709, 1, 11, 1 },
+ { VAProcColorStandardBT2020, 9, 14, 9 },
+#endif
+};
+
+static void vaapi_vpp_fill_colour_standard(VAAPIColourProperties *props,
+ VAProcColorStandardType *vacs,
+ int nb_vacs)
{
- switch(av_cs) {
-#define CS(av, va) case AVCOL_SPC_ ## av: return VAProcColorStandard ## va;
- CS(BT709, BT709);
- CS(BT470BG, BT601);
- CS(SMPTE170M, SMPTE170M);
- CS(SMPTE240M, SMPTE240M);
-#undef CS
+ const VAAPIColourProperties *t;
+ int i, j, score, best_score, worst_score;
+ VAProcColorStandardType best_standard;
+
+#if VA_CHECK_VERSION(1, 3, 0)
+ // If the driver supports explicit use of the standard values then just
+ // use them and avoid doing any mapping. (The driver may not support
+ // some particular code point, but it still has enough information to
+ // make a better fallback choice than we do in that case.)
+ for (i = 0; i < nb_vacs; i++) {
+ if (vacs[i] == VAProcColorStandardExplicit) {
+ props->va_color_standard = VAProcColorStandardExplicit;
+ return;
+ }
+ }
+#endif
+
+ // Give scores to the possible options and choose the lowest one.
+ // An exact match will score zero and therefore always be chosen, as
+ // will a partial match where all unmatched elements are explicitly
+ // unspecified. If no options match at all then just pass "none" to
+ // the driver and let it make its own choice.
+ best_standard = VAProcColorStandardNone;
+ best_score = -1;
+ worst_score = 4 * (props->colorspace != AVCOL_SPC_UNSPECIFIED &&
+ props->colorspace != AVCOL_SPC_RGB) +
+ 2 * (props->color_trc != AVCOL_TRC_UNSPECIFIED) +
+ (props->color_primaries != AVCOL_PRI_UNSPECIFIED);
+
+ if (worst_score == 0) {
+ // No properties are specified, so we aren't going to be able to
+ // make a useful choice.
+ props->va_color_standard = VAProcColorStandardNone;
+ return;
+ }
+
+ for (i = 0; i < nb_vacs; i++) {
+ for (j = 0; j < FF_ARRAY_ELEMS(vaapi_colour_standard_map); j++) {
+ t = &vaapi_colour_standard_map[j];
+ if (t->va_color_standard != vacs[i])
+ continue;
+
+ score = 0;
+ if (props->colorspace != AVCOL_SPC_UNSPECIFIED &&
+ props->colorspace != AVCOL_SPC_RGB)
+ score += 4 * (props->colorspace != t->colorspace);
+ if (props->color_trc != AVCOL_TRC_UNSPECIFIED)
+ score += 2 * (props->color_trc != t->color_trc);
+ if (props->color_primaries != AVCOL_PRI_UNSPECIFIED)
+ score += (props->color_primaries != t->color_primaries);
+
+ // Only include choices which matched something.
+ if (score < worst_score &&
+ (best_score == -1 || score < best_score)) {
+ best_score = score;
+ best_standard = t->va_color_standard;
+ }
+ }
+ }
+ props->va_color_standard = best_standard;
+}
+
+static void vaapi_vpp_fill_chroma_sample_location(VAAPIColourProperties *props)
+{
+#if VA_CHECK_VERSION(1, 1, 0)
+ static const struct {
+ enum AVChromaLocation av;
+ uint8_t va;
+ } csl_map[] = {
+ { AVCHROMA_LOC_UNSPECIFIED, VA_CHROMA_SITING_UNKNOWN },
+ { AVCHROMA_LOC_LEFT, VA_CHROMA_SITING_VERTICAL_CENTER |
+ VA_CHROMA_SITING_HORIZONTAL_LEFT },
+ { AVCHROMA_LOC_CENTER, VA_CHROMA_SITING_VERTICAL_CENTER |
+ VA_CHROMA_SITING_HORIZONTAL_CENTER },
+ { AVCHROMA_LOC_TOPLEFT, VA_CHROMA_SITING_VERTICAL_TOP |
+ VA_CHROMA_SITING_HORIZONTAL_LEFT },
+ { AVCHROMA_LOC_TOP, VA_CHROMA_SITING_VERTICAL_TOP |
+ VA_CHROMA_SITING_HORIZONTAL_CENTER },
+ { AVCHROMA_LOC_BOTTOMLEFT, VA_CHROMA_SITING_VERTICAL_BOTTOM |
+ VA_CHROMA_SITING_HORIZONTAL_LEFT },
+ { AVCHROMA_LOC_BOTTOM, VA_CHROMA_SITING_VERTICAL_BOTTOM |
+ VA_CHROMA_SITING_HORIZONTAL_CENTER },
+ };
+ int i;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(csl_map); i++) {
+ if (props->chroma_sample_location == csl_map[i].av) {
+ props->va_chroma_sample_location = csl_map[i].va;
+ return;
+ }
+ }
+ props->va_chroma_sample_location = VA_CHROMA_SITING_UNKNOWN;
+#else
+ props->va_chroma_sample_location = 0;
+#endif
+}
+
+static void vaapi_vpp_fill_colour_range(VAAPIColourProperties *props)
+{
+#if VA_CHECK_VERSION(1, 1, 0)
+ switch (props->color_range) {
+ case AVCOL_RANGE_MPEG:
+ props->va_color_range = VA_SOURCE_RANGE_REDUCED;
+ break;
+ case AVCOL_RANGE_JPEG:
+ props->va_color_range = VA_SOURCE_RANGE_FULL;
+ break;
+ case AVCOL_RANGE_UNSPECIFIED:
default:
- return VAProcColorStandardNone;
+ props->va_color_range = VA_SOURCE_RANGE_UNKNOWN;
+ }
+#else
+ props->va_color_range = 0;
+#endif
+}
+
+static void vaapi_vpp_fill_colour_properties(AVFilterContext *avctx,
+ VAAPIColourProperties *props,
+ VAProcColorStandardType *vacs,
+ int nb_vacs)
+{
+ vaapi_vpp_fill_colour_standard(props, vacs, nb_vacs);
+ vaapi_vpp_fill_chroma_sample_location(props);
+ vaapi_vpp_fill_colour_range(props);
+
+ av_log(avctx, AV_LOG_DEBUG, "Mapped colour properties %s %s/%s/%s %s "
+ "to VA standard %d chroma siting %#x range %#x.\n",
+ av_color_range_name(props->color_range),
+ av_color_space_name(props->colorspace),
+ av_color_primaries_name(props->color_primaries),
+ av_color_transfer_name(props->color_trc),
+ av_chroma_location_name(props->chroma_sample_location),
+ props->va_color_standard,
+ props->va_chroma_sample_location, props->va_color_range);
+}
+
+static int vaapi_vpp_frame_is_rgb(const AVFrame *frame)
+{
+ const AVHWFramesContext *hwfc;
+ const AVPixFmtDescriptor *desc;
+ av_assert0(frame->format == AV_PIX_FMT_VAAPI &&
+ frame->hw_frames_ctx);
+ hwfc = (const AVHWFramesContext*)frame->hw_frames_ctx->data;
+ desc = av_pix_fmt_desc_get(hwfc->sw_format);
+ av_assert0(desc);
+ return !!(desc->flags & AV_PIX_FMT_FLAG_RGB);
+}
+
+static int vaapi_vpp_colour_properties(AVFilterContext *avctx,
+ VAProcPipelineParameterBuffer *params,
+ const AVFrame *input_frame,
+ AVFrame *output_frame)
+{
+ VAAPIVPPContext *ctx = avctx->priv;
+ VAAPIColourProperties input_props, output_props;
+ VAProcPipelineCaps caps;
+ VAStatus vas;
+
+ vas = vaQueryVideoProcPipelineCaps(ctx->hwctx->display, ctx->va_context,
+ ctx->filter_buffers, ctx->nb_filter_buffers,
+ &caps);
+ if (vas != VA_STATUS_SUCCESS) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to query capabilities for "
+ "colour standard support: %d (%s).\n", vas, vaErrorStr(vas));
+ return AVERROR_EXTERNAL;
}
+
+ input_props = (VAAPIColourProperties) {
+ .colorspace = vaapi_vpp_frame_is_rgb(input_frame)
+ ? AVCOL_SPC_RGB : input_frame->colorspace,
+ .color_primaries = input_frame->color_primaries,
+ .color_trc = input_frame->color_trc,
+ .color_range = input_frame->color_range,
+ .chroma_sample_location = input_frame->chroma_location,
+ };
+
+ vaapi_vpp_fill_colour_properties(avctx, &input_props,
+ caps.input_color_standards,
+ caps.num_input_color_standards);
+
+ output_props = (VAAPIColourProperties) {
+ .colorspace = vaapi_vpp_frame_is_rgb(output_frame)
+ ? AVCOL_SPC_RGB : output_frame->colorspace,
+ .color_primaries = output_frame->color_primaries,
+ .color_trc = output_frame->color_trc,
+ .color_range = output_frame->color_range,
+ .chroma_sample_location = output_frame->chroma_location,
+ };
+ vaapi_vpp_fill_colour_properties(avctx, &output_props,
+ caps.output_color_standards,
+ caps.num_output_color_standards);
+
+ // If the properties weren't filled completely in the output frame and
+ // we chose a fixed standard then fill the known values in here.
+#if VA_CHECK_VERSION(1, 3, 0)
+ if (output_props.va_color_standard != VAProcColorStandardExplicit)
+#endif
+ {
+ const VAAPIColourProperties *output_standard = NULL;
+ int i;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(vaapi_colour_standard_map); i++) {
+ if (output_props.va_color_standard ==
+ vaapi_colour_standard_map[i].va_color_standard) {
+ output_standard = &vaapi_colour_standard_map[i];
+ break;
+ }
+ }
+ if (output_standard) {
+ output_frame->colorspace = vaapi_vpp_frame_is_rgb(output_frame)
+ ? AVCOL_SPC_RGB : output_standard->colorspace;
+ output_frame->color_primaries = output_standard->color_primaries;
+ output_frame->color_trc = output_standard->color_trc;
+ }
+ }
+
+ params->surface_color_standard = input_props.va_color_standard;
+ params->output_color_standard = output_props.va_color_standard;
+
+#if VA_CHECK_VERSION(1, 1, 0)
+ params->input_color_properties = (VAProcColorProperties) {
+ .chroma_sample_location = input_props.va_chroma_sample_location,
+ .color_range = input_props.va_color_range,
+#if VA_CHECK_VERSION(1, 3, 0)
+ .colour_primaries = input_props.color_primaries,
+ .transfer_characteristics = input_props.color_trc,
+ .matrix_coefficients = input_props.colorspace,
+#endif
+ };
+ params->output_color_properties = (VAProcColorProperties) {
+ .chroma_sample_location = output_props.va_chroma_sample_location,
+ .color_range = output_props.va_color_range,
+#if VA_CHECK_VERSION(1, 3, 0)
+ .colour_primaries = output_props.color_primaries,
+ .transfer_characteristics = output_props.color_trc,
+ .matrix_coefficients = output_props.colorspace,
+#endif
+ };
+#endif
+
+ return 0;
+}
+
+int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
+ VAProcPipelineParameterBuffer *params,
+ const AVFrame *input_frame,
+ AVFrame *output_frame)
+{
+ VAAPIVPPContext *ctx = avctx->priv;
+ VASurfaceID input_surface;
+ int err;
+
+ ctx->input_region = (VARectangle) {
+ .x = input_frame->crop_left,
+ .y = input_frame->crop_top,
+ .width = input_frame->width -
+ (input_frame->crop_left + input_frame->crop_right),
+ .height = input_frame->height -
+ (input_frame->crop_top + input_frame->crop_bottom),
+ };
+ output_frame->crop_top = 0;
+ output_frame->crop_bottom = 0;
+ output_frame->crop_left = 0;
+ output_frame->crop_right = 0;
+
+ input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3],
+
+ *params = (VAProcPipelineParameterBuffer) {
+ .surface = input_surface,
+ .surface_region = &ctx->input_region,
+ .output_region = NULL,
+ .output_background_color = VAAPI_VPP_BACKGROUND_BLACK,
+ .pipeline_flags = 0,
+ .filter_flags = VA_FRAME_PICTURE,
+
+ // Filter and reference data filled by the filter itself.
+
+#if VA_CHECK_VERSION(1, 1, 0)
+ .rotation_state = VA_ROTATION_NONE,
+ .mirror_state = VA_MIRROR_NONE,
+#endif
+ };
+
+ err = vaapi_vpp_colour_properties(avctx, params,
+ input_frame, output_frame);
+ if (err < 0)
+ return err;
+
+ return 0;
}
int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
@@ -279,12 +591,15 @@ int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx,
VAProcPipelineParameterBuffer *params,
- VASurfaceID output_surface)
+ AVFrame *output_frame)
{
+ VAAPIVPPContext *ctx = avctx->priv;
+ VASurfaceID output_surface;
VABufferID params_id;
VAStatus vas;
- int err = 0;
- VAAPIVPPContext *ctx = avctx->priv;
+ int err;
+
+ output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
vas = vaBeginPicture(ctx->hwctx->display,
ctx->va_context, output_surface);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.h b/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.h
index 96f720f07d9..c3da91717c9 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.h
+++ b/chromium/third_party/ffmpeg/libavfilter/vaapi_vpp.h
@@ -42,6 +42,7 @@ typedef struct VAAPIVPPContext {
AVBufferRef *input_frames_ref;
AVHWFramesContext *input_frames;
+ VARectangle input_region;
enum AVPixelFormat output_format;
int output_width; // computed width
@@ -67,7 +68,10 @@ int ff_vaapi_vpp_config_input(AVFilterLink *inlink);
int ff_vaapi_vpp_config_output(AVFilterLink *outlink);
-int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs);
+int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
+ VAProcPipelineParameterBuffer *params,
+ const AVFrame *input_frame,
+ AVFrame *output_frame);
int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
int type,
@@ -77,6 +81,6 @@ int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx,
VAProcPipelineParameterBuffer *params,
- VASurfaceID output_surface);
+ AVFrame *output_frame);
#endif /* AVFILTER_VAAPI_VPP_H */
diff --git a/chromium/third_party/ffmpeg/libavfilter/version.h b/chromium/third_party/ffmpeg/libavfilter/version.h
index c494b60d4ba..5bf37fa8b40 100644
--- a/chromium/third_party/ffmpeg/libavfilter/version.h
+++ b/chromium/third_party/ffmpeg/libavfilter/version.h
@@ -30,8 +30,9 @@
#include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 7
-#define LIBAVFILTER_VERSION_MINOR 49
-#define LIBAVFILTER_VERSION_MICRO 100
+#define LIBAVFILTER_VERSION_MINOR 56
+#define LIBAVFILTER_VERSION_MICRO 101
+
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_blend.c b/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
index 80d3e24699d..2f53cfa22a7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_blend.c
@@ -23,7 +23,6 @@
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
#include "avfilter.h"
-#include "bufferqueue.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
@@ -556,169 +555,74 @@ static av_cold void uninit(AVFilterContext *ctx)
av_expr_free(s->params[i].e);
}
+#define DEFINE_INIT_BLEND_FUNC(depth, nbits) \
+static av_cold void init_blend_func_##depth##_##nbits##bit(FilterParams *param) \
+{ \
+ switch (param->mode) { \
+ case BLEND_ADDITION: param->blend = blend_addition_##depth##bit; break; \
+ case BLEND_GRAINMERGE: param->blend = blend_grainmerge_##depth##bit; break; \
+ case BLEND_AND: param->blend = blend_and_##depth##bit; break; \
+ case BLEND_AVERAGE: param->blend = blend_average_##depth##bit; break; \
+ case BLEND_BURN: param->blend = blend_burn_##depth##bit; break; \
+ case BLEND_DARKEN: param->blend = blend_darken_##depth##bit; break; \
+ case BLEND_DIFFERENCE: param->blend = blend_difference_##depth##bit; break; \
+ case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_##depth##bit; break; \
+ case BLEND_DIVIDE: param->blend = blend_divide_##depth##bit; break; \
+ case BLEND_DODGE: param->blend = blend_dodge_##depth##bit; break; \
+ case BLEND_EXCLUSION: param->blend = blend_exclusion_##depth##bit; break; \
+ case BLEND_EXTREMITY: param->blend = blend_extremity_##depth##bit; break; \
+ case BLEND_FREEZE: param->blend = blend_freeze_##depth##bit; break; \
+ case BLEND_GLOW: param->blend = blend_glow_##depth##bit; break; \
+ case BLEND_HARDLIGHT: param->blend = blend_hardlight_##depth##bit; break; \
+ case BLEND_HARDMIX: param->blend = blend_hardmix_##depth##bit; break; \
+ case BLEND_HEAT: param->blend = blend_heat_##depth##bit; break; \
+ case BLEND_LIGHTEN: param->blend = blend_lighten_##depth##bit; break; \
+ case BLEND_LINEARLIGHT:param->blend = blend_linearlight_##depth##bit;break; \
+ case BLEND_MULTIPLY: param->blend = blend_multiply_##depth##bit; break; \
+ case BLEND_MULTIPLY128:param->blend = blend_multiply128_##depth##bit;break; \
+ case BLEND_NEGATION: param->blend = blend_negation_##depth##bit; break; \
+ case BLEND_NORMAL: param->blend = blend_normal_##nbits##bit; break; \
+ case BLEND_OR: param->blend = blend_or_##depth##bit; break; \
+ case BLEND_OVERLAY: param->blend = blend_overlay_##depth##bit; break; \
+ case BLEND_PHOENIX: param->blend = blend_phoenix_##depth##bit; break; \
+ case BLEND_PINLIGHT: param->blend = blend_pinlight_##depth##bit; break; \
+ case BLEND_REFLECT: param->blend = blend_reflect_##depth##bit; break; \
+ case BLEND_SCREEN: param->blend = blend_screen_##depth##bit; break; \
+ case BLEND_SOFTLIGHT: param->blend = blend_softlight_##depth##bit; break; \
+ case BLEND_SUBTRACT: param->blend = blend_subtract_##depth##bit; break; \
+ case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_##depth##bit; break; \
+ case BLEND_XOR: param->blend = blend_xor_##depth##bit; break; \
+ } \
+}
+DEFINE_INIT_BLEND_FUNC(8, 8);
+DEFINE_INIT_BLEND_FUNC(10, 16);
+DEFINE_INIT_BLEND_FUNC(12, 16);
+DEFINE_INIT_BLEND_FUNC(16, 16);
+
void ff_blend_init(FilterParams *param, int depth)
{
switch (depth) {
case 8:
- switch (param->mode) {
- case BLEND_ADDITION: param->blend = blend_addition_8bit; break;
- case BLEND_GRAINMERGE: param->blend = blend_grainmerge_8bit; break;
- case BLEND_AND: param->blend = blend_and_8bit; break;
- case BLEND_AVERAGE: param->blend = blend_average_8bit; break;
- case BLEND_BURN: param->blend = blend_burn_8bit; break;
- case BLEND_DARKEN: param->blend = blend_darken_8bit; break;
- case BLEND_DIFFERENCE: param->blend = blend_difference_8bit; break;
- case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_8bit; break;
- case BLEND_DIVIDE: param->blend = blend_divide_8bit; break;
- case BLEND_DODGE: param->blend = blend_dodge_8bit; break;
- case BLEND_EXCLUSION: param->blend = blend_exclusion_8bit; break;
- case BLEND_EXTREMITY: param->blend = blend_extremity_8bit; break;
- case BLEND_FREEZE: param->blend = blend_freeze_8bit; break;
- case BLEND_GLOW: param->blend = blend_glow_8bit; break;
- case BLEND_HARDLIGHT: param->blend = blend_hardlight_8bit; break;
- case BLEND_HARDMIX: param->blend = blend_hardmix_8bit; break;
- case BLEND_HEAT: param->blend = blend_heat_8bit; break;
- case BLEND_LIGHTEN: param->blend = blend_lighten_8bit; break;
- case BLEND_LINEARLIGHT:param->blend = blend_linearlight_8bit;break;
- case BLEND_MULTIPLY: param->blend = blend_multiply_8bit; break;
- case BLEND_MULTIPLY128:param->blend = blend_multiply128_8bit;break;
- case BLEND_NEGATION: param->blend = blend_negation_8bit; break;
- case BLEND_NORMAL: param->blend = param->opacity == 1 ? blend_copytop_8 :
- param->opacity == 0 ? blend_copybottom_8 :
- blend_normal_8bit; break;
- case BLEND_OR: param->blend = blend_or_8bit; break;
- case BLEND_OVERLAY: param->blend = blend_overlay_8bit; break;
- case BLEND_PHOENIX: param->blend = blend_phoenix_8bit; break;
- case BLEND_PINLIGHT: param->blend = blend_pinlight_8bit; break;
- case BLEND_REFLECT: param->blend = blend_reflect_8bit; break;
- case BLEND_SCREEN: param->blend = blend_screen_8bit; break;
- case BLEND_SOFTLIGHT: param->blend = blend_softlight_8bit; break;
- case BLEND_SUBTRACT: param->blend = blend_subtract_8bit; break;
- case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_8bit; break;
- case BLEND_XOR: param->blend = blend_xor_8bit; break;
- }
+ init_blend_func_8_8bit(param);
break;
case 10:
- switch (param->mode) {
- case BLEND_ADDITION: param->blend = blend_addition_10bit; break;
- case BLEND_GRAINMERGE: param->blend = blend_grainmerge_10bit; break;
- case BLEND_AND: param->blend = blend_and_10bit; break;
- case BLEND_AVERAGE: param->blend = blend_average_10bit; break;
- case BLEND_BURN: param->blend = blend_burn_10bit; break;
- case BLEND_DARKEN: param->blend = blend_darken_10bit; break;
- case BLEND_DIFFERENCE: param->blend = blend_difference_10bit; break;
- case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_10bit; break;
- case BLEND_DIVIDE: param->blend = blend_divide_10bit; break;
- case BLEND_DODGE: param->blend = blend_dodge_10bit; break;
- case BLEND_EXCLUSION: param->blend = blend_exclusion_10bit; break;
- case BLEND_EXTREMITY: param->blend = blend_extremity_10bit; break;
- case BLEND_FREEZE: param->blend = blend_freeze_10bit; break;
- case BLEND_GLOW: param->blend = blend_glow_10bit; break;
- case BLEND_HARDLIGHT: param->blend = blend_hardlight_10bit; break;
- case BLEND_HARDMIX: param->blend = blend_hardmix_10bit; break;
- case BLEND_HEAT: param->blend = blend_heat_10bit; break;
- case BLEND_LIGHTEN: param->blend = blend_lighten_10bit; break;
- case BLEND_LINEARLIGHT:param->blend = blend_linearlight_10bit;break;
- case BLEND_MULTIPLY: param->blend = blend_multiply_10bit; break;
- case BLEND_MULTIPLY128:param->blend = blend_multiply128_10bit;break;
- case BLEND_NEGATION: param->blend = blend_negation_10bit; break;
- case BLEND_NORMAL: param->blend = param->opacity == 1 ? blend_copytop_16 :
- param->opacity == 0 ? blend_copybottom_16 :
- blend_normal_16bit; break;
- case BLEND_OR: param->blend = blend_or_10bit; break;
- case BLEND_OVERLAY: param->blend = blend_overlay_10bit; break;
- case BLEND_PHOENIX: param->blend = blend_phoenix_10bit; break;
- case BLEND_PINLIGHT: param->blend = blend_pinlight_10bit; break;
- case BLEND_REFLECT: param->blend = blend_reflect_10bit; break;
- case BLEND_SCREEN: param->blend = blend_screen_10bit; break;
- case BLEND_SOFTLIGHT: param->blend = blend_softlight_10bit; break;
- case BLEND_SUBTRACT: param->blend = blend_subtract_10bit; break;
- case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_10bit;break;
- case BLEND_XOR: param->blend = blend_xor_10bit; break;
- }
+ init_blend_func_10_16bit(param);
break;
case 12:
- switch (param->mode) {
- case BLEND_ADDITION: param->blend = blend_addition_12bit; break;
- case BLEND_GRAINMERGE: param->blend = blend_grainmerge_12bit; break;
- case BLEND_AND: param->blend = blend_and_12bit; break;
- case BLEND_AVERAGE: param->blend = blend_average_12bit; break;
- case BLEND_BURN: param->blend = blend_burn_12bit; break;
- case BLEND_DARKEN: param->blend = blend_darken_12bit; break;
- case BLEND_DIFFERENCE: param->blend = blend_difference_12bit; break;
- case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_12bit; break;
- case BLEND_DIVIDE: param->blend = blend_divide_12bit; break;
- case BLEND_DODGE: param->blend = blend_dodge_12bit; break;
- case BLEND_EXCLUSION: param->blend = blend_exclusion_12bit; break;
- case BLEND_EXTREMITY: param->blend = blend_extremity_12bit; break;
- case BLEND_FREEZE: param->blend = blend_freeze_12bit; break;
- case BLEND_GLOW: param->blend = blend_glow_12bit; break;
- case BLEND_HARDLIGHT: param->blend = blend_hardlight_12bit; break;
- case BLEND_HARDMIX: param->blend = blend_hardmix_12bit; break;
- case BLEND_HEAT: param->blend = blend_heat_12bit; break;
- case BLEND_LIGHTEN: param->blend = blend_lighten_12bit; break;
- case BLEND_LINEARLIGHT:param->blend = blend_linearlight_12bit;break;
- case BLEND_MULTIPLY: param->blend = blend_multiply_12bit; break;
- case BLEND_MULTIPLY128:param->blend = blend_multiply128_12bit;break;
- case BLEND_NEGATION: param->blend = blend_negation_12bit; break;
- case BLEND_NORMAL: param->blend = param->opacity == 1 ? blend_copytop_16 :
- param->opacity == 0 ? blend_copybottom_16 :
- blend_normal_16bit; break;
- case BLEND_OR: param->blend = blend_or_12bit; break;
- case BLEND_OVERLAY: param->blend = blend_overlay_12bit; break;
- case BLEND_PHOENIX: param->blend = blend_phoenix_12bit; break;
- case BLEND_PINLIGHT: param->blend = blend_pinlight_12bit; break;
- case BLEND_REFLECT: param->blend = blend_reflect_12bit; break;
- case BLEND_SCREEN: param->blend = blend_screen_12bit; break;
- case BLEND_SOFTLIGHT: param->blend = blend_softlight_12bit; break;
- case BLEND_SUBTRACT: param->blend = blend_subtract_12bit; break;
- case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_12bit;break;
- case BLEND_XOR: param->blend = blend_xor_12bit; break;
- }
+ init_blend_func_12_16bit(param);
break;
case 16:
- switch (param->mode) {
- case BLEND_ADDITION: param->blend = blend_addition_16bit; break;
- case BLEND_GRAINMERGE: param->blend = blend_grainmerge_16bit; break;
- case BLEND_AND: param->blend = blend_and_16bit; break;
- case BLEND_AVERAGE: param->blend = blend_average_16bit; break;
- case BLEND_BURN: param->blend = blend_burn_16bit; break;
- case BLEND_DARKEN: param->blend = blend_darken_16bit; break;
- case BLEND_DIFFERENCE: param->blend = blend_difference_16bit; break;
- case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_16bit; break;
- case BLEND_DIVIDE: param->blend = blend_divide_16bit; break;
- case BLEND_DODGE: param->blend = blend_dodge_16bit; break;
- case BLEND_EXCLUSION: param->blend = blend_exclusion_16bit; break;
- case BLEND_EXTREMITY: param->blend = blend_extremity_16bit; break;
- case BLEND_FREEZE: param->blend = blend_freeze_16bit; break;
- case BLEND_GLOW: param->blend = blend_glow_16bit; break;
- case BLEND_HARDLIGHT: param->blend = blend_hardlight_16bit; break;
- case BLEND_HARDMIX: param->blend = blend_hardmix_16bit; break;
- case BLEND_HEAT: param->blend = blend_heat_16bit; break;
- case BLEND_LIGHTEN: param->blend = blend_lighten_16bit; break;
- case BLEND_LINEARLIGHT:param->blend = blend_linearlight_16bit;break;
- case BLEND_MULTIPLY: param->blend = blend_multiply_16bit; break;
- case BLEND_MULTIPLY128:param->blend = blend_multiply128_16bit;break;
- case BLEND_NEGATION: param->blend = blend_negation_16bit; break;
- case BLEND_NORMAL: param->blend = param->opacity == 1 ? blend_copytop_16 :
- param->opacity == 0 ? blend_copybottom_16 :
- blend_normal_16bit; break;
- case BLEND_OR: param->blend = blend_or_16bit; break;
- case BLEND_OVERLAY: param->blend = blend_overlay_16bit; break;
- case BLEND_PHOENIX: param->blend = blend_phoenix_16bit; break;
- case BLEND_PINLIGHT: param->blend = blend_pinlight_16bit; break;
- case BLEND_REFLECT: param->blend = blend_reflect_16bit; break;
- case BLEND_SCREEN: param->blend = blend_screen_16bit; break;
- case BLEND_SOFTLIGHT: param->blend = blend_softlight_16bit; break;
- case BLEND_SUBTRACT: param->blend = blend_subtract_16bit; break;
- case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_16bit;break;
- case BLEND_XOR: param->blend = blend_xor_16bit; break;
- }
+ init_blend_func_16_16bit(param);
break;
}
if (param->opacity == 0 && param->mode != BLEND_NORMAL) {
param->blend = depth > 8 ? blend_copytop_16 : blend_copytop_8;
+ } else if (param->mode == BLEND_NORMAL) {
+ if (param->opacity == 1)
+ param->blend = depth > 8 ? blend_copytop_16 : blend_copytop_8;
+ else if (param->opacity == 0)
+ param->blend = depth > 8 ? blend_copybottom_16 : blend_copybottom_8;
}
if (ARCH_X86)
@@ -790,7 +694,13 @@ static int config_output(AVFilterLink *outlink)
}
}
- return s->tblend ? 0 : ff_framesync_configure(&s->fs);
+ if (s->tblend)
+ return 0;
+
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
#if CONFIG_BLEND_FILTER
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_chromakey.c b/chromium/third_party/ffmpeg/libavfilter/vf_chromakey.c
index 42b7d71d494..76a5e2056a3 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_chromakey.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_chromakey.c
@@ -128,7 +128,12 @@ static int do_chromahold_slice(AVFilterContext *avctx, void *arg, int jobnr, int
diff = sqrt((du * du + dv * dv) / (255.0 * 255.0));
alpha = diff > ctx->similarity;
- if (alpha) {
+ if (ctx->blend > 0.0001) {
+ double f = 1. - av_clipd((diff - ctx->similarity) / ctx->blend, 0.0, 1.0);
+
+ frame->data[1][frame->linesize[1] * y + x] = 128 + (u - 128) * f;
+ frame->data[2][frame->linesize[2] * y + x] = 128 + (v - 128) * f;
+ } else if (alpha) {
frame->data[1][frame->linesize[1] * y + x] = 128;
frame->data[2][frame->linesize[2] * y + x] = 128;
}
@@ -262,6 +267,7 @@ AVFilter ff_vf_chromakey = {
static const AVOption chromahold_options[] = {
{ "color", "set the chromahold key color", OFFSET(chromakey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "similarity", "set the chromahold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
+ { "blend", "set the chromahold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
{ "yuv", "color parameter is in yuv instead of rgb", OFFSET(is_yuv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c b/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
index 3d65e59d42c..4e37c7f0c9e 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colorkey.c
@@ -34,6 +34,9 @@ typedef struct ColorkeyContext {
uint8_t colorkey_rgba[4];
float similarity;
float blend;
+
+ int (*do_slice)(AVFilterContext *ctx, void *arg,
+ int jobnr, int nb_jobs);
} ColorkeyContext;
static uint8_t do_colorkey_pixel(ColorkeyContext *ctx, uint8_t r, uint8_t g, uint8_t b)
@@ -77,15 +80,65 @@ static int do_colorkey_slice(AVFilterContext *avctx, void *arg, int jobnr, int n
return 0;
}
+static int do_colorhold_slice(AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
+{
+ AVFrame *frame = arg;
+
+ const int slice_start = (frame->height * jobnr) / nb_jobs;
+ const int slice_end = (frame->height * (jobnr + 1)) / nb_jobs;
+
+ ColorkeyContext *ctx = avctx->priv;
+
+ int x, y;
+
+ for (y = slice_start; y < slice_end; ++y) {
+ for (x = 0; x < frame->width; ++x) {
+ int o, t, r, g, b;
+
+ o = frame->linesize[0] * y + x * 4;
+ r = frame->data[0][o + ctx->co[0]];
+ g = frame->data[0][o + ctx->co[1]];
+ b = frame->data[0][o + ctx->co[2]];
+
+ t = do_colorkey_pixel(ctx, r, g, b);
+
+ if (t > 0) {
+ int a = (r + g + b) / 3;
+ int rt = 255 - t;
+
+ frame->data[0][o + ctx->co[0]] = (a * t + r * rt + 127) >> 8;
+ frame->data[0][o + ctx->co[1]] = (a * t + g * rt + 127) >> 8;
+ frame->data[0][o + ctx->co[2]] = (a * t + b * rt + 127) >> 8;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static av_cold int init_filter(AVFilterContext *avctx)
+{
+ ColorkeyContext *ctx = avctx->priv;
+
+ if (!strcmp(avctx->filter->name, "colorkey")) {
+ ctx->do_slice = do_colorkey_slice;
+ } else {
+ ctx->do_slice = do_colorhold_slice;
+ }
+
+ return 0;
+}
+
static int filter_frame(AVFilterLink *link, AVFrame *frame)
{
AVFilterContext *avctx = link->dst;
+ ColorkeyContext *ctx = avctx->priv;
int res;
if (res = av_frame_make_writable(frame))
return res;
- if (res = avctx->internal->execute(avctx, do_colorkey_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
+ if (res = avctx->internal->execute(avctx, ctx->do_slice, frame, NULL, FFMIN(frame->height, ff_filter_get_nb_threads(avctx))))
return res;
return ff_filter_frame(avctx->outputs[0], frame);
@@ -148,6 +201,8 @@ static const AVFilterPad colorkey_outputs[] = {
#define OFFSET(x) offsetof(ColorkeyContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#if CONFIG_COLORKEY_FILTER
+
static const AVOption colorkey_options[] = {
{ "color", "set the colorkey key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
@@ -163,7 +218,34 @@ AVFilter ff_vf_colorkey = {
.priv_size = sizeof(ColorkeyContext),
.priv_class = &colorkey_class,
.query_formats = query_formats,
+ .init = init_filter,
.inputs = colorkey_inputs,
.outputs = colorkey_outputs,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
};
+
+#endif /* CONFIG_COLORKEY_FILTER */
+#if CONFIG_COLORHOLD_FILTER
+
+static const AVOption colorhold_options[] = {
+ { "color", "set the colorhold key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "similarity", "set the colorhold similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
+ { "blend", "set the colorhold blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(colorhold);
+
+AVFilter ff_vf_colorhold = {
+ .name = "colorhold",
+ .description = NULL_IF_CONFIG_SMALL("Turns a certain color range into gray. Operates on RGB colors."),
+ .priv_size = sizeof(ColorkeyContext),
+ .priv_class = &colorhold_class,
+ .query_formats = query_formats,
+ .init = init_filter,
+ .inputs = colorkey_inputs,
+ .outputs = colorkey_outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
+};
+
+#endif /* CONFIG_COLORHOLD_FILTER */
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c b/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
index 5385a5e7542..fadb39e0049 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colorlevels.c
@@ -105,6 +105,68 @@ static int config_input(AVFilterLink *inlink)
return 0;
}
+struct thread_data {
+ const uint8_t *srcrow;
+ uint8_t *dstrow;
+ int dst_linesize;
+ int src_linesize;
+
+ double coeff;
+ uint8_t offset;
+
+ int h;
+
+ int imin;
+ int omin;
+};
+
+#define LOAD_COMMON\
+ ColorLevelsContext *s = ctx->priv;\
+ const struct thread_data *td = arg;\
+\
+ int process_h = td->h;\
+ const int slice_start = (process_h * jobnr ) / nb_jobs;\
+ const int slice_end = (process_h * (jobnr+1)) / nb_jobs;\
+ int x, y;\
+ const uint8_t *srcrow = td->srcrow;\
+ uint8_t *dstrow = td->dstrow;\
+ const int step = s->step;\
+ const uint8_t offset = td->offset;\
+\
+ int imin = td->imin;\
+ int omin = td->omin;\
+ double coeff = td->coeff;\
+
+static int colorlevel_slice_8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_COMMON
+
+ for (y = slice_start; y < slice_end; y++) {
+ const uint8_t *src = srcrow + y * td->src_linesize;
+ uint8_t *dst = dstrow + y * td->dst_linesize;
+
+ for (x = 0; x < s->linesize; x += step)
+ dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + omin);
+ }
+
+ return 0;
+}
+
+static int colorlevel_slice_16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_COMMON
+
+ for (y = slice_start; y < slice_end; y++) {
+ const uint16_t *src = (const uint16_t *)(srcrow + y * td->src_linesize);
+ uint16_t *dst = (uint16_t *)(dstrow + y * td->dst_linesize);
+
+ for (x = 0; x < s->linesize; x += step)
+ dst[x + offset] = av_clip_uint16((src[x + offset] - imin) * coeff + omin);
+ }
+
+ return 0;
+}
+
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
@@ -137,6 +199,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int omin = lrint(r->out_min * UINT8_MAX);
int omax = lrint(r->out_max * UINT8_MAX);
double coeff;
+ struct thread_data td;
if (imin < 0) {
imin = UINT8_MAX;
@@ -162,15 +225,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
srcrow = in->data[0];
coeff = (omax - omin) / (double)(imax - imin);
- for (y = 0; y < inlink->h; y++) {
- const uint8_t *src = srcrow;
- uint8_t *dst = dstrow;
-
- for (x = 0; x < s->linesize; x += step)
- dst[x + offset] = av_clip_uint8((src[x + offset] - imin) * coeff + omin);
- dstrow += out->linesize[0];
- srcrow += in->linesize[0];
- }
+
+ td.srcrow = srcrow;
+ td.dstrow = dstrow;
+ td.dst_linesize = out->linesize[0];
+ td.src_linesize = in->linesize[0];
+ td.coeff = coeff;
+ td.offset = offset;
+ td.h = inlink->h;
+ td.imin = imin;
+ td.omin = omin;
+
+ ctx->internal->execute(ctx, colorlevel_slice_8, &td, NULL,
+ FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
}
break;
case 2:
@@ -184,6 +251,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
int omin = lrint(r->out_min * UINT16_MAX);
int omax = lrint(r->out_max * UINT16_MAX);
double coeff;
+ struct thread_data td;
if (imin < 0) {
imin = UINT16_MAX;
@@ -209,15 +277,19 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
srcrow = in->data[0];
coeff = (omax - omin) / (double)(imax - imin);
- for (y = 0; y < inlink->h; y++) {
- const uint16_t *src = (const uint16_t*)srcrow;
- uint16_t *dst = (uint16_t *)dstrow;
-
- for (x = 0; x < s->linesize; x += step)
- dst[x + offset] = av_clip_uint16((src[x + offset] - imin) * coeff + omin);
- dstrow += out->linesize[0];
- srcrow += in->linesize[0];
- }
+
+ td.srcrow = srcrow;
+ td.dstrow = dstrow;
+ td.dst_linesize = out->linesize[0];
+ td.src_linesize = in->linesize[0];
+ td.coeff = coeff;
+ td.offset = offset;
+ td.h = inlink->h;
+ td.imin = imin;
+ td.omin = omin;
+
+ ctx->internal->execute(ctx, colorlevel_slice_16, &td, NULL,
+ FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
}
}
@@ -252,5 +324,5 @@ AVFilter ff_vf_colorlevels = {
.query_formats = query_formats,
.inputs = colorlevels_inputs,
.outputs = colorlevels_outputs,
- .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_colorspace.c b/chromium/third_party/ffmpeg/libavfilter/vf_colorspace.c
index 2120199beed..df6efffb3dc 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_colorspace.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_colorspace.c
@@ -260,9 +260,9 @@ static int fill_gamma_table(ColorSpaceContext *s)
s->delin_lut[n] = av_clip_int16(lrint(d * 28672.0));
// linearize
- if (v <= -in_beta) {
+ if (v <= -in_beta * in_delta) {
l = -pow((1.0 - in_alpha - v) * in_ialpha, in_igamma);
- } else if (v < in_beta) {
+ } else if (v < in_beta * in_delta) {
l = v * in_idelta;
} else {
l = pow((v + in_alpha - 1.0) * in_ialpha, in_igamma);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c b/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
index f7f61038e39..898debf09d1 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_cover_rect.c
@@ -152,7 +152,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
if (!xendptr || *xendptr || !yendptr || *yendptr ||
- !wendptr || *wendptr || !hendptr || !hendptr
+ !wendptr || *wendptr || !hendptr || *hendptr
) {
return ff_filter_frame(ctx->outputs[0], in);
}
@@ -198,6 +198,7 @@ static av_cold void uninit(AVFilterContext *ctx)
if (cover->cover_frame)
av_freep(&cover->cover_frame->data[0]);
+ av_frame_free(&cover->cover_frame);
}
static av_cold int init(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
index 84be4c7d0d2..9fca7a73096 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_crop.c
@@ -98,9 +98,17 @@ static int query_formats(AVFilterContext *ctx)
for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
- if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM)) &&
- !((desc->log2_chroma_w || desc->log2_chroma_h) && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) &&
- (ret = ff_add_format(&formats, fmt)) < 0)
+ if (desc->flags & AV_PIX_FMT_FLAG_BITSTREAM)
+ continue;
+ if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
+ // Not usable if there is any subsampling but the format is
+ // not planar (e.g. YUYV422).
+ if ((desc->log2_chroma_w || desc->log2_chroma_h) &&
+ !(desc->flags & AV_PIX_FMT_FLAG_PLANAR))
+ continue;
+ }
+ ret = ff_add_format(&formats, fmt);
+ if (ret < 0)
return ret;
}
@@ -157,8 +165,14 @@ static int config_input(AVFilterLink *link)
s->var_values[VAR_POS] = NAN;
av_image_fill_max_pixsteps(s->max_step, NULL, pix_desc);
- s->hsub = pix_desc->log2_chroma_w;
- s->vsub = pix_desc->log2_chroma_h;
+
+ if (pix_desc->flags & AV_PIX_FMT_FLAG_HWACCEL) {
+ s->hsub = 1;
+ s->vsub = 1;
+ } else {
+ s->hsub = pix_desc->log2_chroma_w;
+ s->vsub = pix_desc->log2_chroma_h;
+ }
if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
var_names, s->var_values,
@@ -237,9 +251,15 @@ fail_expr:
static int config_output(AVFilterLink *link)
{
CropContext *s = link->src->priv;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
- link->w = s->w;
- link->h = s->h;
+ if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL) {
+ // Hardware frames adjust the cropping regions rather than
+ // changing the frame size.
+ } else {
+ link->w = s->w;
+ link->h = s->h;
+ }
link->sample_aspect_ratio = s->out_sar;
return 0;
@@ -252,9 +272,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
int i;
- frame->width = s->w;
- frame->height = s->h;
-
s->var_values[VAR_N] = link->frame_count_out;
s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
NAN : frame->pts * av_q2d(link->time_base);
@@ -285,22 +302,32 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
(int)s->var_values[VAR_N], s->var_values[VAR_T], s->var_values[VAR_POS],
s->x, s->y, s->x+s->w, s->y+s->h);
- frame->data[0] += s->y * frame->linesize[0];
- frame->data[0] += s->x * s->max_step[0];
-
- if (!(desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & FF_PSEUDOPAL)) {
- for (i = 1; i < 3; i ++) {
- if (frame->data[i]) {
- frame->data[i] += (s->y >> s->vsub) * frame->linesize[i];
- frame->data[i] += (s->x * s->max_step[i]) >> s->hsub;
+ if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL) {
+ frame->crop_top += s->y;
+ frame->crop_left += s->x;
+ frame->crop_bottom = frame->height - frame->crop_top - frame->crop_bottom - s->h;
+ frame->crop_right = frame->width - frame->crop_left - frame->crop_right - s->w;
+ } else {
+ frame->width = s->w;
+ frame->height = s->h;
+
+ frame->data[0] += s->y * frame->linesize[0];
+ frame->data[0] += s->x * s->max_step[0];
+
+ if (!(desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & FF_PSEUDOPAL)) {
+ for (i = 1; i < 3; i ++) {
+ if (frame->data[i]) {
+ frame->data[i] += (s->y >> s->vsub) * frame->linesize[i];
+ frame->data[i] += (s->x * s->max_step[i]) >> s->hsub;
+ }
}
}
- }
- /* alpha plane */
- if (frame->data[3]) {
- frame->data[3] += s->y * frame->linesize[3];
- frame->data[3] += s->x * s->max_step[3];
+ /* alpha plane */
+ if (frame->data[3]) {
+ frame->data[3] += s->y * frame->linesize[3];
+ frame->data[3] += s->x * s->max_step[3];
+ }
}
return ff_filter_frame(link->dst->outputs[0], frame);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_qsv.c b/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_qsv.c
index bee10c220f6..80217c84199 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_qsv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_qsv.c
@@ -83,7 +83,7 @@ typedef struct QSVDeintContext {
int mode;
} QSVDeintContext;
-static void qsvdeint_uninit(AVFilterContext *ctx)
+static av_cold void qsvdeint_uninit(AVFilterContext *ctx)
{
QSVDeintContext *s = ctx->priv;
QSVFrame *cur;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_vaapi.c b/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_vaapi.c
index f67a1c8e796..72d034981ab 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_deinterlace_vaapi.c
@@ -181,12 +181,11 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
VAAPIVPPContext *vpp_ctx = avctx->priv;
DeintVAAPIContext *ctx = avctx->priv;
AVFrame *output_frame = NULL;
- VASurfaceID input_surface, output_surface;
+ VASurfaceID input_surface;
VASurfaceID backward_references[MAX_REFERENCES];
VASurfaceID forward_references[MAX_REFERENCES];
VAProcPipelineParameterBuffer params;
VAProcFilterParameterBufferDeinterlacing *filter_params;
- VARectangle input_region;
VAStatus vas;
void *filter_params_addr = NULL;
int err, i, field, current_frame_index;
@@ -238,30 +237,14 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
- output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for "
- "deinterlace output.\n", output_surface);
-
- memset(&params, 0, sizeof(params));
-
- input_region = (VARectangle) {
- .x = 0,
- .y = 0,
- .width = input_frame->width,
- .height = input_frame->height,
- };
-
- params.surface = input_surface;
- params.surface_region = &input_region;
- params.surface_color_standard =
- ff_vaapi_vpp_colour_standard(input_frame->colorspace);
-
- params.output_region = NULL;
- params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
- params.output_color_standard = params.surface_color_standard;
+ err = av_frame_copy_props(output_frame, input_frame);
+ if (err < 0)
+ return err;
- params.pipeline_flags = 0;
- params.filter_flags = VA_FRAME_PICTURE;
+ err = ff_vaapi_vpp_init_params(avctx, &params,
+ input_frame, output_frame);
+ if (err < 0)
+ goto fail;
if (!ctx->auto_enable || input_frame->interlaced_frame) {
vas = vaMapBuffer(vpp_ctx->hwctx->display, vpp_ctx->filter_buffers[0],
@@ -301,11 +284,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
params.num_filters = 0;
}
- err = ff_vaapi_vpp_render_picture(avctx, &params, output_surface);
- if (err < 0)
- goto fail;
-
- err = av_frame_copy_props(output_frame, input_frame);
+ err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
if (err < 0)
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_derain.c b/chromium/third_party/ffmpeg/libavfilter/vf_derain.c
new file mode 100644
index 00000000000..c380b401226
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_derain.c
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2019 Xuewei Meng
+ *
+ * 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
+ * Filter implementing image derain filter using deep convolutional networks.
+ * http://openaccess.thecvf.com/content_ECCV_2018/html/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.html
+ */
+
+#include "libavformat/avio.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "dnn_interface.h"
+#include "formats.h"
+#include "internal.h"
+
+typedef struct DRContext {
+ const AVClass *class;
+
+ char *model_filename;
+ DNNBackendType backend_type;
+ DNNModule *dnn_module;
+ DNNModel *model;
+ DNNInputData input;
+ DNNData output;
+} DRContext;
+
+#define CLIP(x, min, max) (x < min ? min : (x > max ? max : x))
+#define OFFSET(x) offsetof(DRContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
+static const AVOption derain_options[] = {
+ { "dnn_backend", "DNN backend", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
+ { "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
+#if (CONFIG_LIBTENSORFLOW == 1)
+ { "tensorflow", "tensorflow backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "backend" },
+#endif
+ { "model", "path to model file", OFFSET(model_filename), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(derain);
+
+static int query_formats(AVFilterContext *ctx)
+{
+ AVFilterFormats *formats;
+ const enum AVPixelFormat pixel_fmts[] = {
+ AV_PIX_FMT_RGB24,
+ AV_PIX_FMT_NONE
+ };
+
+ formats = ff_make_format_list(pixel_fmts);
+
+ return ff_set_common_formats(ctx, formats);
+}
+
+static int config_inputs(AVFilterLink *inlink)
+{
+ AVFilterContext *ctx = inlink->dst;
+ DRContext *dr_context = ctx->priv;
+ const char *model_output_name = "y";
+ DNNReturnType result;
+
+ dr_context->input.width = inlink->w;
+ dr_context->input.height = inlink->h;
+ dr_context->input.channels = 3;
+
+ result = (dr_context->model->set_input_output)(dr_context->model->model, &dr_context->input, "x", &model_output_name, 1);
+ if (result != DNN_SUCCESS) {
+ av_log(ctx, AV_LOG_ERROR, "could not set input and output for the model\n");
+ return AVERROR(EIO);
+ }
+
+ return 0;
+}
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+ AVFilterContext *ctx = inlink->dst;
+ AVFilterLink *outlink = ctx->outputs[0];
+ DRContext *dr_context = ctx->priv;
+ DNNReturnType dnn_result;
+ int pad_size;
+
+ AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out) {
+ av_log(ctx, AV_LOG_ERROR, "could not allocate memory for output frame\n");
+ av_frame_free(&in);
+ return AVERROR(ENOMEM);
+ }
+
+ av_frame_copy_props(out, in);
+
+ for (int i = 0; i < in->height; i++){
+ for(int j = 0; j < in->width * 3; j++){
+ int k = i * in->linesize[0] + j;
+ int t = i * in->width * 3 + j;
+ ((float *)dr_context->input.data)[t] = in->data[0][k] / 255.0;
+ }
+ }
+
+ dnn_result = (dr_context->dnn_module->execute_model)(dr_context->model, &dr_context->output, 1);
+ if (dnn_result != DNN_SUCCESS){
+ av_log(ctx, AV_LOG_ERROR, "failed to execute model\n");
+ return AVERROR(EIO);
+ }
+
+ out->height = dr_context->output.height;
+ out->width = dr_context->output.width;
+ outlink->h = dr_context->output.height;
+ outlink->w = dr_context->output.width;
+ pad_size = (in->height - out->height) >> 1;
+
+ for (int i = 0; i < out->height; i++){
+ for(int j = 0; j < out->width * 3; j++){
+ int k = i * out->linesize[0] + j;
+ int t = i * out->width * 3 + j;
+
+ int t_in = (i + pad_size) * in->width * 3 + j + pad_size * 3;
+ out->data[0][k] = CLIP((int)((((float *)dr_context->input.data)[t_in] - dr_context->output.data[t]) * 255), 0, 255);
+ }
+ }
+
+ av_frame_free(&in);
+
+ return ff_filter_frame(outlink, out);
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ DRContext *dr_context = ctx->priv;
+
+ dr_context->input.dt = DNN_FLOAT;
+ dr_context->dnn_module = ff_get_dnn_module(dr_context->backend_type);
+ if (!dr_context->dnn_module) {
+ av_log(ctx, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
+ return AVERROR(ENOMEM);
+ }
+ if (!dr_context->model_filename) {
+ av_log(ctx, AV_LOG_ERROR, "model file for network is not specified\n");
+ return AVERROR(EINVAL);
+ }
+ if (!dr_context->dnn_module->load_model) {
+ av_log(ctx, AV_LOG_ERROR, "load_model for network is not specified\n");
+ return AVERROR(EINVAL);
+ }
+
+ dr_context->model = (dr_context->dnn_module->load_model)(dr_context->model_filename);
+ if (!dr_context->model) {
+ av_log(ctx, AV_LOG_ERROR, "could not load DNN model\n");
+ return AVERROR(EINVAL);
+ }
+
+ return 0;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ DRContext *dr_context = ctx->priv;
+
+ if (dr_context->dnn_module) {
+ (dr_context->dnn_module->free_model)(&dr_context->model);
+ av_freep(&dr_context->dnn_module);
+ }
+}
+
+static const AVFilterPad derain_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_inputs,
+ .filter_frame = filter_frame,
+ },
+ { NULL }
+};
+
+static const AVFilterPad derain_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_derain = {
+ .name = "derain",
+ .description = NULL_IF_CONFIG_SMALL("Apply derain filter to the input."),
+ .priv_size = sizeof(DRContext),
+ .init = init,
+ .uninit = uninit,
+ .query_formats = query_formats,
+ .inputs = derain_inputs,
+ .outputs = derain_outputs,
+ .priv_class = &derain_class,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
index cca2cbcb88b..8f4badbdb50 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_drawtext.c
@@ -88,6 +88,9 @@ static const char *const var_names[] = {
"x",
"y",
"pict_type",
+ "pkt_pos",
+ "pkt_duration",
+ "pkt_size",
NULL
};
@@ -125,6 +128,9 @@ enum var_name {
VAR_X,
VAR_Y,
VAR_PICT_TYPE,
+ VAR_PKT_POS,
+ VAR_PKT_DURATION,
+ VAR_PKT_SIZE,
VAR_VARS_NB
};
@@ -862,20 +868,49 @@ static int config_input(AVFilterLink *inlink)
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
{
- DrawTextContext *s = ctx->priv;
+ DrawTextContext *old = ctx->priv;
+ DrawTextContext *new = NULL;
+ int ret;
if (!strcmp(cmd, "reinit")) {
- int ret;
+ new = av_mallocz(sizeof(DrawTextContext));
+ if (!new)
+ return AVERROR(ENOMEM);
+
+ new->class = &drawtext_class;
+ ret = av_opt_copy(new, old);
+ if (ret < 0)
+ goto fail;
+
+ ctx->priv = new;
+ ret = av_set_options_string(ctx, arg, "=", ":");
+ if (ret < 0) {
+ ctx->priv = old;
+ goto fail;
+ }
+
+ ret = init(ctx);
+ if (ret < 0) {
+ uninit(ctx);
+ ctx->priv = old;
+ goto fail;
+ }
+
+ new->reinit = 1;
+
+ ctx->priv = old;
uninit(ctx);
- s->reinit = 1;
- if ((ret = av_set_options_string(ctx, arg, "=", ":")) < 0)
- return ret;
- if ((ret = init(ctx)) < 0)
- return ret;
+ av_freep(&old);
+
+ ctx->priv = new;
return config_input(ctx->inputs[0]);
- }
+ } else
+ return AVERROR(ENOSYS);
- return AVERROR(ENOSYS);
+fail:
+ av_log(ctx, AV_LOG_ERROR, "Failed to process command. Continuing with existing parameters.\n");
+ av_freep(&new);
+ return ret;
}
static int func_pict_type(AVFilterContext *ctx, AVBPrint *bp,
@@ -1487,6 +1522,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
NAN : frame->pts * av_q2d(inlink->time_base);
s->var_values[VAR_PICT_TYPE] = frame->pict_type;
+ s->var_values[VAR_PKT_POS] = frame->pkt_pos;
+ s->var_values[VAR_PKT_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base);
+ s->var_values[VAR_PKT_SIZE] = frame->pkt_size;
s->metadata = frame->metadata;
draw_text(ctx, frame, frame->width, frame->height);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_freezedetect.c b/chromium/third_party/ffmpeg/libavfilter/vf_freezedetect.c
index 299a5dfbf67..cc086afee62 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_freezedetect.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_freezedetect.c
@@ -177,10 +177,9 @@ static int activate(AVFilterContext *ctx)
frozen = is_frozen(s, s->reference_frame, frame);
if (duration >= s->duration) {
- if (frozen) {
- if (!s->frozen)
- set_meta(s, frame, "lavfi.freezedetect.freeze_start", av_ts2timestr(s->reference_frame->pts, &inlink->time_base));
- } else {
+ if (!s->frozen)
+ set_meta(s, frame, "lavfi.freezedetect.freeze_start", av_ts2timestr(s->reference_frame->pts, &inlink->time_base));
+ if (!frozen) {
set_meta(s, frame, "lavfi.freezedetect.freeze_duration", av_ts2timestr(duration, &AV_TIME_BASE_Q));
set_meta(s, frame, "lavfi.freezedetect.freeze_end", av_ts2timestr(frame->pts, &inlink->time_base));
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c b/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
index 165fbd7d81e..5d38405999d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_frei0r.c
@@ -93,7 +93,7 @@ static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, cha
double d;
f0r_param_color_t col;
f0r_param_position_t pos;
- f0r_param_string *str;
+ f0r_param_string str;
} val;
char *tail;
uint8_t rgba[4];
@@ -127,7 +127,7 @@ static int set_param(AVFilterContext *ctx, f0r_param_info_t info, int index, cha
break;
case F0R_PARAM_STRING:
- val.str = (f0r_param_string *)param;
+ val.str = param;
break;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_gblur.c b/chromium/third_party/ffmpeg/libavfilter/vf_gblur.c
index f77a3fffc38..e71b33da800 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_gblur.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_gblur.c
@@ -30,30 +30,10 @@
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
+#include "gblur.h"
#include "internal.h"
#include "video.h"
-typedef struct GBlurContext {
- const AVClass *class;
-
- float sigma;
- float sigmaV;
- int steps;
- int planes;
-
- int depth;
- int planewidth[4];
- int planeheight[4];
- float *buffer;
- float boundaryscale;
- float boundaryscaleV;
- float postscale;
- float postscaleV;
- float nu;
- float nuV;
- int nb_planes;
-} GBlurContext;
-
#define OFFSET(x) offsetof(GBlurContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
@@ -72,6 +52,28 @@ typedef struct ThreadData {
int width;
} ThreadData;
+static void horiz_slice_c(float *buffer, int width, int height, int steps,
+ float nu, float bscale)
+{
+ int step, x, y;
+ float *ptr;
+ for (y = 0; y < height; y++) {
+ for (step = 0; step < steps; step++) {
+ ptr = buffer + width * y;
+ ptr[0] *= bscale;
+
+ /* Filter rightwards */
+ for (x = 1; x < width; x++)
+ ptr[x] += nu * ptr[x - 1];
+ ptr[x = width - 1] *= bscale;
+
+ /* Filter leftwards */
+ for (; x > 0; x--)
+ ptr[x - 1] += nu * ptr[x];
+ }
+ }
+}
+
static int filter_horizontally(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
GBlurContext *s = ctx->priv;
@@ -84,28 +86,45 @@ static int filter_horizontally(AVFilterContext *ctx, void *arg, int jobnr, int n
const int steps = s->steps;
const float nu = s->nu;
float *buffer = s->buffer;
- int y, x, step;
- float *ptr;
- /* Filter horizontally along each row */
- for (y = slice_start; y < slice_end; y++) {
- for (step = 0; step < steps; step++) {
- ptr = buffer + width * y;
- ptr[0] *= boundaryscale;
+ s->horiz_slice(buffer + width * slice_start, width, slice_end - slice_start,
+ steps, nu, boundaryscale);
+ emms_c();
+ return 0;
+}
- /* Filter rightwards */
- for (x = 1; x < width; x++)
- ptr[x] += nu * ptr[x - 1];
+static void do_vertical_columns(float *buffer, int width, int height,
+ int column_begin, int column_end, int steps,
+ float nu, float boundaryscale, int column_step)
+{
+ const int numpixels = width * height;
+ int i, x, k, step;
+ float *ptr;
+ for (x = column_begin; x < column_end;) {
+ for (step = 0; step < steps; step++) {
+ ptr = buffer + x;
+ for (k = 0; k < column_step; k++) {
+ ptr[k] *= boundaryscale;
+ }
+ /* Filter downwards */
+ for (i = width; i < numpixels; i += width) {
+ for (k = 0; k < column_step; k++) {
+ ptr[i + k] += nu * ptr[i - width + k];
+ }
+ }
+ i = numpixels - width;
- ptr[x = width - 1] *= boundaryscale;
+ for (k = 0; k < column_step; k++)
+ ptr[i + k] *= boundaryscale;
- /* Filter leftwards */
- for (; x > 0; x--)
- ptr[x - 1] += nu * ptr[x];
+ /* Filter upwards */
+ for (; i > 0; i -= width) {
+ for (k = 0; k < column_step; k++)
+ ptr[i - width + k] += nu * ptr[i + k];
+ }
}
+ x += column_step;
}
-
- return 0;
}
static int filter_vertically(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
@@ -117,31 +136,19 @@ static int filter_vertically(AVFilterContext *ctx, void *arg, int jobnr, int nb_
const int slice_start = (width * jobnr ) / nb_jobs;
const int slice_end = (width * (jobnr+1)) / nb_jobs;
const float boundaryscale = s->boundaryscaleV;
- const int numpixels = width * height;
const int steps = s->steps;
const float nu = s->nuV;
float *buffer = s->buffer;
- int i, x, step;
- float *ptr;
+ int aligned_end;
- /* Filter vertically along each column */
- for (x = slice_start; x < slice_end; x++) {
- for (step = 0; step < steps; step++) {
- ptr = buffer + x;
- ptr[0] *= boundaryscale;
-
- /* Filter downwards */
- for (i = width; i < numpixels; i += width)
- ptr[i] += nu * ptr[i - width];
-
- ptr[i = numpixels - width] *= boundaryscale;
-
- /* Filter upwards */
- for (; i > 0; i -= width)
- ptr[i - width] += nu * ptr[i];
- }
- }
+ aligned_end = slice_start + (((slice_end - slice_start) >> 3) << 3);
+ /* Filter vertically along columns (process 8 columns in each step) */
+ do_vertical_columns(buffer, width, height, slice_start, aligned_end,
+ steps, nu, boundaryscale, 8);
+ /* Filter un-aligned columns one by one */
+ do_vertical_columns(buffer, width, height, aligned_end, slice_end,
+ steps, nu, boundaryscale, 1);
return 0;
}
@@ -209,6 +216,13 @@ static int query_formats(AVFilterContext *ctx)
return ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
}
+void ff_gblur_init(GBlurContext *s)
+{
+ s->horiz_slice = horiz_slice_c;
+ if (ARCH_X86_64)
+ ff_gblur_init_x86(s);
+}
+
static int config_input(AVFilterLink *inlink)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
@@ -229,6 +243,7 @@ static int config_input(AVFilterLink *inlink)
if (s->sigmaV < 0) {
s->sigmaV = s->sigma;
}
+ ff_gblur_init(s);
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lensfun.c b/chromium/third_party/ffmpeg/libavfilter/vf_lensfun.c
index 3b723dd2d03..089121ed088 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lensfun.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lensfun.c
@@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
vignetting_filter_slice,
&vignetting_thread_data,
NULL,
- FFMIN(outlink->h, ctx->graph->nb_threads));
+ FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
}
if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) {
@@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
distortion_correction_filter_slice,
&distortion_correction_thread_data,
NULL,
- FFMIN(outlink->h, ctx->graph->nb_threads));
+ FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
av_frame_free(&in);
return ff_filter_frame(outlink, out);
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
index c815ddc1941..1fdc5e18125 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut.c
@@ -337,13 +337,194 @@ static int config_props(AVFilterLink *inlink)
return 0;
}
+struct thread_data {
+ AVFrame *in;
+ AVFrame *out;
+
+ int w;
+ int h;
+};
+
+#define LOAD_PACKED_COMMON\
+ LutContext *s = ctx->priv;\
+ const struct thread_data *td = arg;\
+\
+ int i, j;\
+ const int w = td->w;\
+ const int h = td->h;\
+ AVFrame *in = td->in;\
+ AVFrame *out = td->out;\
+ const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;\
+ const int step = s->step;\
+\
+ const int slice_start = (h * jobnr ) / nb_jobs;\
+ const int slice_end = (h * (jobnr+1)) / nb_jobs;\
+
+/* packed, 16-bit */
+static int lut_packed_16bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_PACKED_COMMON
+
+ uint16_t *inrow, *outrow, *inrow0, *outrow0;
+ const int in_linesize = in->linesize[0] / 2;
+ const int out_linesize = out->linesize[0] / 2;
+ inrow0 = (uint16_t *)in ->data[0];
+ outrow0 = (uint16_t *)out->data[0];
+
+ for (i = slice_start; i < slice_end; i++) {
+ inrow = inrow0 + i * in_linesize;
+ outrow = outrow0 + i * out_linesize;
+ for (j = 0; j < w; j++) {
+
+ switch (step) {
+#if HAVE_BIGENDIAN
+ case 4: outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // Fall-through
+ case 3: outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // Fall-through
+ case 2: outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // Fall-through
+ default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
+#else
+ case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
+ case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
+ case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
+ default: outrow[0] = tab[0][inrow[0]];
+#endif
+ }
+ outrow += step;
+ inrow += step;
+ }
+ }
+
+ return 0;
+}
+
+/* packed, 8-bit */
+static int lut_packed_8bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_PACKED_COMMON
+
+ uint8_t *inrow, *outrow, *inrow0, *outrow0;
+ const int in_linesize = in->linesize[0];
+ const int out_linesize = out->linesize[0];
+ inrow0 = in ->data[0];
+ outrow0 = out->data[0];
+
+ for (i = slice_start; i < slice_end; i++) {
+ inrow = inrow0 + i * in_linesize;
+ outrow = outrow0 + i * out_linesize;
+ for (j = 0; j < w; j++) {
+ switch (step) {
+ case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
+ case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
+ case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
+ default: outrow[0] = tab[0][inrow[0]];
+ }
+ outrow += step;
+ inrow += step;
+ }
+ }
+
+ return 0;
+}
+
+#define LOAD_PLANAR_COMMON\
+ LutContext *s = ctx->priv;\
+ const struct thread_data *td = arg;\
+ int i, j, plane;\
+ AVFrame *in = td->in;\
+ AVFrame *out = td->out;\
+
+#define PLANAR_COMMON\
+ int vsub = plane == 1 || plane == 2 ? s->vsub : 0;\
+ int hsub = plane == 1 || plane == 2 ? s->hsub : 0;\
+ int h = AV_CEIL_RSHIFT(td->h, vsub);\
+ int w = AV_CEIL_RSHIFT(td->w, hsub);\
+ const uint16_t *tab = s->lut[plane];\
+\
+ const int slice_start = (h * jobnr ) / nb_jobs;\
+ const int slice_end = (h * (jobnr+1)) / nb_jobs;\
+
+/* planar >8 bit depth */
+static int lut_planar_16bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_PLANAR_COMMON
+
+ uint16_t *inrow, *outrow;
+
+ for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
+ PLANAR_COMMON
+
+ const int in_linesize = in->linesize[plane] / 2;
+ const int out_linesize = out->linesize[plane] / 2;
+
+ inrow = (uint16_t *)in ->data[plane] + slice_start * in_linesize;
+ outrow = (uint16_t *)out->data[plane] + slice_start * out_linesize;
+
+ for (i = slice_start; i < slice_end; i++) {
+ for (j = 0; j < w; j++) {
+#if HAVE_BIGENDIAN
+ outrow[j] = av_bswap16(tab[av_bswap16(inrow[j])]);
+#else
+ outrow[j] = tab[inrow[j]];
+#endif
+ }
+ inrow += in_linesize;
+ outrow += out_linesize;
+ }
+ }
+
+ return 0;
+}
+
+/* planar 8bit depth */
+static int lut_planar_8bits(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ LOAD_PLANAR_COMMON
+
+ uint8_t *inrow, *outrow;
+
+ for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
+ PLANAR_COMMON
+
+ const int in_linesize = in->linesize[plane];
+ const int out_linesize = out->linesize[plane];
+
+ inrow = in ->data[plane] + slice_start * in_linesize;
+ outrow = out->data[plane] + slice_start * out_linesize;
+
+ for (i = slice_start; i < slice_end; i++) {
+ for (j = 0; j < w; j++)
+ outrow[j] = tab[inrow[j]];
+ inrow += in_linesize;
+ outrow += out_linesize;
+ }
+ }
+
+ return 0;
+}
+
+#define PACKED_THREAD_DATA\
+ struct thread_data td = {\
+ .in = in,\
+ .out = out,\
+ .w = inlink->w,\
+ .h = in->height,\
+ };\
+
+#define PLANAR_THREAD_DATA\
+ struct thread_data td = {\
+ .in = in,\
+ .out = out,\
+ .w = inlink->w,\
+ .h = inlink->h,\
+ };\
+
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
{
AVFilterContext *ctx = inlink->dst;
LutContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out;
- int i, j, plane, direct = 0;
+ int direct = 0;
if (av_frame_is_writable(in)) {
direct = 1;
@@ -359,121 +540,24 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
if (s->is_rgb && s->is_16bit && !s->is_planar) {
/* packed, 16-bit */
- uint16_t *inrow, *outrow, *inrow0, *outrow0;
- const int w = inlink->w;
- const int h = in->height;
- const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
- const int in_linesize = in->linesize[0] / 2;
- const int out_linesize = out->linesize[0] / 2;
- const int step = s->step;
-
- inrow0 = (uint16_t*) in ->data[0];
- outrow0 = (uint16_t*) out->data[0];
-
- for (i = 0; i < h; i ++) {
- inrow = inrow0;
- outrow = outrow0;
- for (j = 0; j < w; j++) {
-
- switch (step) {
-#if HAVE_BIGENDIAN
- case 4: outrow[3] = av_bswap16(tab[3][av_bswap16(inrow[3])]); // Fall-through
- case 3: outrow[2] = av_bswap16(tab[2][av_bswap16(inrow[2])]); // Fall-through
- case 2: outrow[1] = av_bswap16(tab[1][av_bswap16(inrow[1])]); // Fall-through
- default: outrow[0] = av_bswap16(tab[0][av_bswap16(inrow[0])]);
-#else
- case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
- case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
- case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
- default: outrow[0] = tab[0][inrow[0]];
-#endif
- }
- outrow += step;
- inrow += step;
- }
- inrow0 += in_linesize;
- outrow0 += out_linesize;
- }
+ PACKED_THREAD_DATA
+ ctx->internal->execute(ctx, lut_packed_16bits, &td, NULL,
+ FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
} else if (s->is_rgb && !s->is_planar) {
- /* packed */
- uint8_t *inrow, *outrow, *inrow0, *outrow0;
- const int w = inlink->w;
- const int h = in->height;
- const uint16_t (*tab)[256*256] = (const uint16_t (*)[256*256])s->lut;
- const int in_linesize = in->linesize[0];
- const int out_linesize = out->linesize[0];
- const int step = s->step;
-
- inrow0 = in ->data[0];
- outrow0 = out->data[0];
-
- for (i = 0; i < h; i ++) {
- inrow = inrow0;
- outrow = outrow0;
- for (j = 0; j < w; j++) {
- switch (step) {
- case 4: outrow[3] = tab[3][inrow[3]]; // Fall-through
- case 3: outrow[2] = tab[2][inrow[2]]; // Fall-through
- case 2: outrow[1] = tab[1][inrow[1]]; // Fall-through
- default: outrow[0] = tab[0][inrow[0]];
- }
- outrow += step;
- inrow += step;
- }
- inrow0 += in_linesize;
- outrow0 += out_linesize;
- }
+ /* packed 8 bits */
+ PACKED_THREAD_DATA
+ ctx->internal->execute(ctx, lut_packed_8bits, &td, NULL,
+ FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
} else if (s->is_16bit) {
- // planar >8 bit depth
- uint16_t *inrow, *outrow;
-
- for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
- int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
- int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
- int h = AV_CEIL_RSHIFT(inlink->h, vsub);
- int w = AV_CEIL_RSHIFT(inlink->w, hsub);
- const uint16_t *tab = s->lut[plane];
- const int in_linesize = in->linesize[plane] / 2;
- const int out_linesize = out->linesize[plane] / 2;
-
- inrow = (uint16_t *)in ->data[plane];
- outrow = (uint16_t *)out->data[plane];
-
- for (i = 0; i < h; i++) {
- for (j = 0; j < w; j++) {
-#if HAVE_BIGENDIAN
- outrow[j] = av_bswap16(tab[av_bswap16(inrow[j])]);
-#else
- outrow[j] = tab[inrow[j]];
-#endif
- }
- inrow += in_linesize;
- outrow += out_linesize;
- }
- }
+ /* planar >8 bit depth */
+ PLANAR_THREAD_DATA
+ ctx->internal->execute(ctx, lut_planar_16bits, &td, NULL,
+ FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
} else {
/* planar 8bit depth */
- uint8_t *inrow, *outrow;
-
- for (plane = 0; plane < 4 && in->data[plane] && in->linesize[plane]; plane++) {
- int vsub = plane == 1 || plane == 2 ? s->vsub : 0;
- int hsub = plane == 1 || plane == 2 ? s->hsub : 0;
- int h = AV_CEIL_RSHIFT(inlink->h, vsub);
- int w = AV_CEIL_RSHIFT(inlink->w, hsub);
- const uint16_t *tab = s->lut[plane];
- const int in_linesize = in->linesize[plane];
- const int out_linesize = out->linesize[plane];
-
- inrow = in ->data[plane];
- outrow = out->data[plane];
-
- for (i = 0; i < h; i++) {
- for (j = 0; j < w; j++)
- outrow[j] = tab[inrow[j]];
- inrow += in_linesize;
- outrow += out_linesize;
- }
- }
+ PLANAR_THREAD_DATA
+ ctx->internal->execute(ctx, lut_planar_8bits, &td, NULL,
+ FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
}
if (!direct)
@@ -508,7 +592,7 @@ static const AVFilterPad outputs[] = {
.query_formats = query_formats, \
.inputs = inputs, \
.outputs = outputs, \
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, \
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, \
}
#if CONFIG_LUT_FILTER
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_lut2.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut2.c
index d765dc9ad2a..721de7d2107 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut2.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut2.c
@@ -70,10 +70,13 @@ typedef struct LUT2Context {
int tlut2;
AVFrame *prev_frame; /* only used with tlut2 */
- void (*lut2)(struct LUT2Context *s, AVFrame *dst, AVFrame *srcx, AVFrame *srcy);
-
+ int (*lut2)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
} LUT2Context;
+typedef struct ThreadData {
+ AVFrame *out, *srcx, *srcy;
+} ThreadData;
+
#define OFFSET(x) offsetof(LUT2Context, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
@@ -238,24 +241,31 @@ static int config_inputy(AVFilterLink *inlink)
}
#define DEFINE_LUT2(zname, xname, yname, ztype, xtype, ytype, zdiv, xdiv, ydiv) \
-static void lut2_##zname##_##xname##_##yname(struct LUT2Context *s, \
- AVFrame *out, \
- AVFrame *srcx, AVFrame *srcy) \
+static int lut2_##zname##_##xname##_##yname(AVFilterContext *ctx, \
+ void *arg, \
+ int jobnr, int nb_jobs) \
{ \
+ LUT2Context *s = ctx->priv; \
+ ThreadData *td = arg; \
+ AVFrame *out = td->out; \
+ AVFrame *srcx = td->srcx; \
+ AVFrame *srcy = td->srcy; \
const int odepth = s->odepth; \
int p, y, x; \
\
for (p = 0; p < s->nb_planes; p++) { \
+ const int slice_start = (s->heightx[p] * jobnr) / nb_jobs; \
+ const int slice_end = (s->heightx[p] * (jobnr+1)) / nb_jobs; \
const uint16_t *lut = s->lut[p]; \
const xtype *srcxx; \
const ytype *srcyy; \
ztype *dst; \
\
- dst = (ztype *)out->data[p]; \
- srcxx = (const xtype *)srcx->data[p]; \
- srcyy = (const ytype *)srcy->data[p]; \
+ dst = (ztype *)(out->data[p] + slice_start * out->linesize[p]); \
+ srcxx = (const xtype *)(srcx->data[p] + slice_start * srcx->linesize[p]);\
+ srcyy = (const ytype *)(srcy->data[p] + slice_start * srcy->linesize[p]);\
\
- for (y = 0; y < s->heightx[p]; y++) { \
+ for (y = slice_start; y < slice_end; y++) { \
for (x = 0; x < s->widthx[p]; x++) { \
dst[x] = av_clip_uintp2_c(lut[(srcyy[x] << s->depthx) | srcxx[x]], odepth); \
} \
@@ -265,6 +275,7 @@ static void lut2_##zname##_##xname##_##yname(struct LUT2Context *s,
srcyy += srcy->linesize[p] / ydiv; \
} \
} \
+ return 0; \
}
DEFINE_LUT2(8, 8, 8, uint8_t, uint8_t, uint8_t, 1, 1, 1)
@@ -293,12 +304,17 @@ static int process_frame(FFFrameSync *fs)
if (!out)
return AVERROR(ENOMEM);
} else {
+ ThreadData td;
+
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out)
return AVERROR(ENOMEM);
av_frame_copy_props(out, srcx);
- s->lut2(s, out, srcx, srcy);
+ td.out = out;
+ td.srcx = srcx;
+ td.srcy = srcy;
+ ctx->internal->execute(ctx, s->lut2, &td, NULL, FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
}
out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
@@ -491,7 +507,10 @@ static int lut2_config_output(AVFilterLink *outlink)
if ((ret = config_output(outlink)) < 0)
return ret;
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static int activate(AVFilterContext *ctx)
@@ -538,7 +557,8 @@ AVFilter ff_vf_lut2 = {
.activate = activate,
.inputs = inputs,
.outputs = outputs,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL |
+ AVFILTER_FLAG_SLICE_THREADS,
};
#if CONFIG_TLUT2_FILTER
@@ -564,6 +584,8 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame)
if (ctx->is_disabled) {
out = av_frame_clone(frame);
} else {
+ ThreadData td;
+
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
av_frame_free(&s->prev_frame);
@@ -572,7 +594,11 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
av_frame_copy_props(out, frame);
- s->lut2(s, out, frame, s->prev_frame);
+
+ td.out = out;
+ td.srcx = frame;
+ td.srcy = s->prev_frame;
+ ctx->internal->execute(ctx, s->lut2, &td, NULL, FFMIN(s->heightx[1], ff_filter_get_nb_threads(ctx)));
}
av_frame_free(&s->prev_frame);
s->prev_frame = frame;
@@ -621,7 +647,8 @@ AVFilter ff_vf_tlut2 = {
.uninit = uninit,
.inputs = tlut2_inputs,
.outputs = tlut2_outputs,
- .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_lut3d.c b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
index 50ea5a85457..a525039baa6 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_lut3d.c
@@ -55,7 +55,7 @@ struct rgbvec {
/* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT
* of 512x512 (64x64x64) */
-#define MAX_LEVEL 64
+#define MAX_LEVEL 128
typedef struct LUT3DContext {
const AVClass *class;
@@ -64,6 +64,7 @@ typedef struct LUT3DContext {
uint8_t rgba_map[4];
int step;
avfilter_action_func *interp;
+ struct rgbvec scale;
struct rgbvec lut[MAX_LEVEL][MAX_LEVEL][MAX_LEVEL];
int lutsize;
#if CONFIG_HALDCLUT_FILTER
@@ -219,7 +220,9 @@ static int interp_##nbits##_##name##_p##depth(AVFilterContext *ctx, void *arg, i
const uint8_t *srcbrow = in->data[1] + slice_start * in->linesize[1]; \
const uint8_t *srcrrow = in->data[2] + slice_start * in->linesize[2]; \
const uint8_t *srcarow = in->data[3] + slice_start * in->linesize[3]; \
- const float scale = (1. / ((1<<depth) - 1)) * (lut3d->lutsize - 1); \
+ const float scale_r = (lut3d->scale.r / ((1<<depth) - 1)) * (lut3d->lutsize - 1); \
+ const float scale_g = (lut3d->scale.g / ((1<<depth) - 1)) * (lut3d->lutsize - 1); \
+ const float scale_b = (lut3d->scale.b / ((1<<depth) - 1)) * (lut3d->lutsize - 1); \
\
for (y = slice_start; y < slice_end; y++) { \
uint##nbits##_t *dstg = (uint##nbits##_t *)grow; \
@@ -231,9 +234,9 @@ static int interp_##nbits##_##name##_p##depth(AVFilterContext *ctx, void *arg, i
const uint##nbits##_t *srcr = (const uint##nbits##_t *)srcrrow; \
const uint##nbits##_t *srca = (const uint##nbits##_t *)srcarow; \
for (x = 0; x < in->width; x++) { \
- const struct rgbvec scaled_rgb = {srcr[x] * scale, \
- srcg[x] * scale, \
- srcb[x] * scale}; \
+ const struct rgbvec scaled_rgb = {srcr[x] * scale_r, \
+ srcg[x] * scale_g, \
+ srcb[x] * scale_b}; \
struct rgbvec vec = interp_##name(lut3d, &scaled_rgb); \
dstr[x] = av_clip_uintp2(vec.r * (float)((1<<depth) - 1), depth); \
dstg[x] = av_clip_uintp2(vec.g * (float)((1<<depth) - 1), depth); \
@@ -295,15 +298,17 @@ static int interp_##nbits##_##name(AVFilterContext *ctx, void *arg, int jobnr, i
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); \
+ const float scale_r = (lut3d->scale.r / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
+ const float scale_g = (lut3d->scale.g / ((1<<nbits) - 1)) * (lut3d->lutsize - 1); \
+ const float scale_b = (lut3d->scale.b / ((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}; \
+ const struct rgbvec scaled_rgb = {src[x + r] * scale_r, \
+ src[x + g] * scale_g, \
+ src[x + b] * scale_b}; \
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)); \
@@ -417,15 +422,17 @@ try_again:
} while (skip_line(line));
if (av_sscanf(line, "%f %f %f", &vec->r, &vec->g, &vec->b) != 3)
return AVERROR_INVALIDDATA;
- vec->r *= max[0] - min[0];
- vec->g *= max[1] - min[1];
- vec->b *= max[2] - min[2];
}
}
}
break;
}
}
+
+ lut3d->scale.r = av_clipf(1. / (max[0] - min[0]), 0.f, 1.f);
+ lut3d->scale.g = av_clipf(1. / (max[1] - min[1]), 0.f, 1.f);
+ lut3d->scale.b = av_clipf(1. / (max[2] - min[2]), 0.f, 1.f);
+
return 0;
}
@@ -609,6 +616,11 @@ static int parse_cinespace(AVFilterContext *ctx, FILE *f)
break;
}
}
+
+ lut3d->scale.r = av_clipf(1. / (in_max[0] - in_min[0]), 0.f, 1.f);
+ lut3d->scale.g = av_clipf(1. / (in_max[1] - in_min[1]), 0.f, 1.f);
+ lut3d->scale.b = av_clipf(1. / (in_max[2] - in_min[2]), 0.f, 1.f);
+
return 0;
}
@@ -765,6 +777,8 @@ static av_cold int lut3d_init(AVFilterContext *ctx)
const char *ext;
LUT3DContext *lut3d = ctx->priv;
+ lut3d->scale.r = lut3d->scale.g = lut3d->scale.b = 1.f;
+
if (!lut3d->file) {
set_identity_matrix(lut3d, 32);
return 0;
@@ -1016,6 +1030,7 @@ static int update_apply_clut(FFFrameSync *fs)
static av_cold int haldclut_init(AVFilterContext *ctx)
{
LUT3DContext *lut3d = ctx->priv;
+ lut3d->scale.r = lut3d->scale.g = lut3d->scale.b = 1.f;
lut3d->fs.on_event = update_apply_clut;
return 0;
}
@@ -1087,6 +1102,7 @@ typedef struct LUT1DContext {
const AVClass *class;
char *file;
int interpolation; ///<interp_1d_mode
+ struct rgbvec scale;
uint8_t rgba_map[4];
int step;
float lut[3][MAX_1D_LEVEL];
@@ -1182,6 +1198,11 @@ static int parse_cinespace_1d(AVFilterContext *ctx, FILE *f)
break;
}
}
+
+ lut1d->scale.r = av_clipf(1. / (in_max[0] - in_min[0]), 0.f, 1.f);
+ lut1d->scale.g = av_clipf(1. / (in_max[1] - in_min[1]), 0.f, 1.f);
+ lut1d->scale.b = av_clipf(1. / (in_max[2] - in_min[2]), 0.f, 1.f);
+
return 0;
}
@@ -1227,13 +1248,15 @@ try_again:
} while (skip_line(line));
if (av_sscanf(line, "%f %f %f", &lut1d->lut[0][i], &lut1d->lut[1][i], &lut1d->lut[2][i]) != 3)
return AVERROR_INVALIDDATA;
- lut1d->lut[0][i] *= max[0] - min[0];
- lut1d->lut[1][i] *= max[1] - min[1];
- lut1d->lut[2][i] *= max[2] - min[2];
}
break;
}
}
+
+ lut1d->scale.r = av_clipf(1. / (max[0] - min[0]), 0.f, 1.f);
+ lut1d->scale.g = av_clipf(1. / (max[1] - min[1]), 0.f, 1.f);
+ lut1d->scale.b = av_clipf(1. / (max[2] - min[2]), 0.f, 1.f);
+
return 0;
}
@@ -1349,7 +1372,9 @@ static int interp_1d_##nbits##_##name##_p##depth(AVFilterContext *ctx, \
const uint8_t *srcrrow = in->data[2] + slice_start * in->linesize[2]; \
const uint8_t *srcarow = in->data[3] + slice_start * in->linesize[3]; \
const float factor = (1 << depth) - 1; \
- const float scale = (1. / factor) * (lut1d->lutsize - 1); \
+ const float scale_r = (lut1d->scale.r / factor) * (lut1d->lutsize - 1); \
+ const float scale_g = (lut1d->scale.g / factor) * (lut1d->lutsize - 1); \
+ const float scale_b = (lut1d->scale.b / factor) * (lut1d->lutsize - 1); \
\
for (y = slice_start; y < slice_end; y++) { \
uint##nbits##_t *dstg = (uint##nbits##_t *)grow; \
@@ -1361,9 +1386,9 @@ static int interp_1d_##nbits##_##name##_p##depth(AVFilterContext *ctx, \
const uint##nbits##_t *srcr = (const uint##nbits##_t *)srcrrow; \
const uint##nbits##_t *srca = (const uint##nbits##_t *)srcarow; \
for (x = 0; x < in->width; x++) { \
- float r = srcr[x] * scale; \
- float g = srcg[x] * scale; \
- float b = srcb[x] * scale; \
+ float r = srcr[x] * scale_r; \
+ float g = srcg[x] * scale_g; \
+ float b = srcb[x] * scale_b; \
r = interp_1d_##name(lut1d, 0, r); \
g = interp_1d_##name(lut1d, 1, g); \
b = interp_1d_##name(lut1d, 2, b); \
@@ -1441,15 +1466,17 @@ static int interp_1d_##nbits##_##name(AVFilterContext *ctx, void *arg, \
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 factor = (1 << nbits) - 1; \
- const float scale = (1. / factor) * (lut1d->lutsize - 1); \
+ const float scale_r = (lut1d->scale.r / factor) * (lut1d->lutsize - 1); \
+ const float scale_g = (lut1d->scale.g / factor) * (lut1d->lutsize - 1); \
+ const float scale_b = (lut1d->scale.b / factor) * (lut1d->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) { \
- float rr = src[x + r] * scale; \
- float gg = src[x + g] * scale; \
- float bb = src[x + b] * scale; \
+ float rr = src[x + r] * scale_r; \
+ float gg = src[x + g] * scale_g; \
+ float bb = src[x + b] * scale_b; \
rr = interp_1d_##name(lut1d, 0, rr); \
gg = interp_1d_##name(lut1d, 1, gg); \
bb = interp_1d_##name(lut1d, 2, bb); \
@@ -1544,6 +1571,8 @@ static av_cold int lut1d_init(AVFilterContext *ctx)
const char *ext;
LUT1DContext *lut1d = ctx->priv;
+ lut1d->scale.r = lut1d->scale.g = lut1d->scale.b = 1.f;
+
if (!lut1d->file) {
set_identity_matrix_1d(lut1d, 32);
return 0;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_maskedclamp.c b/chromium/third_party/ffmpeg/libavfilter/vf_maskedclamp.c
index 8a06737ed33..16444e9de3d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_maskedclamp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_maskedclamp.c
@@ -279,7 +279,6 @@ static int config_output(AVFilterLink *outlink)
outlink->w = base->w;
outlink->h = base->h;
- outlink->time_base = base->time_base;
outlink->sample_aspect_ratio = base->sample_aspect_ratio;
outlink->frame_rate = base->frame_rate;
@@ -302,7 +301,10 @@ static int config_output(AVFilterLink *outlink)
s->fs.opaque = s;
s->fs.on_event = process_frame;
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static int activate(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_maskedmerge.c b/chromium/third_party/ffmpeg/libavfilter/vf_maskedmerge.c
index 1a0250375e4..30e0cd0f948 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_maskedmerge.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_maskedmerge.c
@@ -246,7 +246,6 @@ static int config_output(AVFilterLink *outlink)
outlink->w = base->w;
outlink->h = base->h;
- outlink->time_base = base->time_base;
outlink->sample_aspect_ratio = base->sample_aspect_ratio;
outlink->frame_rate = base->frame_rate;
@@ -272,7 +271,10 @@ static int config_output(AVFilterLink *outlink)
s->fs.opaque = s;
s->fs.on_event = process_frame;
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static int activate(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_midequalizer.c b/chromium/third_party/ffmpeg/libavfilter/vf_midequalizer.c
index 87d1e7cb31e..6266cd7d5e7 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_midequalizer.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_midequalizer.c
@@ -307,7 +307,6 @@ static int config_output(AVFilterLink *outlink)
outlink->w = in0->w;
outlink->h = in0->h;
- outlink->time_base = in0->time_base;
outlink->sample_aspect_ratio = in0->sample_aspect_ratio;
outlink->frame_rate = in0->frame_rate;
@@ -326,7 +325,10 @@ static int config_output(AVFilterLink *outlink)
s->fs.opaque = s;
s->fs.on_event = process_frame;
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static int activate(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_misc_vaapi.c b/chromium/third_party/ffmpeg/libavfilter/vf_misc_vaapi.c
index e227c9ff6b9..54516d7e356 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_misc_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_misc_vaapi.c
@@ -84,10 +84,9 @@ static int denoise_vaapi_build_filter_params(AVFilterContext *avctx)
denoise.value = map(ctx->denoise, DENOISE_MIN, DENOISE_MAX,
caps.range.min_value,
caps.range.max_value);
- ff_vaapi_vpp_make_param_buffers(avctx, VAProcFilterParameterBufferType,
- &denoise, sizeof(denoise), 1);
-
- return 0;
+ return ff_vaapi_vpp_make_param_buffers(avctx,
+ VAProcFilterParameterBufferType,
+ &denoise, sizeof(denoise), 1);
}
static int sharpness_vaapi_build_filter_params(AVFilterContext *avctx)
@@ -116,11 +115,9 @@ static int sharpness_vaapi_build_filter_params(AVFilterContext *avctx)
SHARPNESS_MIN, SHARPNESS_MAX,
caps.range.min_value,
caps.range.max_value);
- ff_vaapi_vpp_make_param_buffers(avctx,
- VAProcFilterParameterBufferType,
- &sharpness, sizeof(sharpness), 1);
-
- return 0;
+ return ff_vaapi_vpp_make_param_buffers(avctx,
+ VAProcFilterParameterBufferType,
+ &sharpness, sizeof(sharpness), 1);
}
static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
@@ -129,9 +126,6 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
AVFilterLink *outlink = avctx->outputs[0];
VAAPIVPPContext *vpp_ctx = avctx->priv;
AVFrame *output_frame = NULL;
- VASurfaceID input_surface, output_surface;
- VARectangle input_region;
-
VAProcPipelineParameterBuffer params;
int err;
@@ -142,10 +136,6 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
if (vpp_ctx->va_context == VA_INVALID_ID)
return AVERROR(EINVAL);
- input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for misc vpp input.\n",
- input_surface);
-
output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
vpp_ctx->output_height);
if (!output_frame) {
@@ -153,40 +143,24 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
- output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for misc vpp output.\n",
- output_surface);
- memset(&params, 0, sizeof(params));
- input_region = (VARectangle) {
- .x = 0,
- .y = 0,
- .width = input_frame->width,
- .height = input_frame->height,
- };
+ err = av_frame_copy_props(output_frame, input_frame);
+ if (err < 0)
+ return err;
+
+ err = ff_vaapi_vpp_init_params(avctx, &params,
+ input_frame, output_frame);
+ if (err < 0)
+ goto fail;
if (vpp_ctx->nb_filter_buffers) {
params.filters = &vpp_ctx->filter_buffers[0];
params.num_filters = vpp_ctx->nb_filter_buffers;
}
- params.surface = input_surface;
- params.surface_region = &input_region;
- params.surface_color_standard =
- ff_vaapi_vpp_colour_standard(input_frame->colorspace);
-
- params.output_region = NULL;
- params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
- params.output_color_standard = params.surface_color_standard;
- params.pipeline_flags = 0;
- params.filter_flags = VA_FRAME_PICTURE;
-
- err = ff_vaapi_vpp_render_picture(avctx, &params, output_surface);
+ err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
if (err < 0)
goto fail;
- err = av_frame_copy_props(output_frame, input_frame);
- if (err < 0)
- goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_mix.c b/chromium/third_party/ffmpeg/libavfilter/vf_mix.c
index 873bef9dc3c..b5a282ad4ce 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_mix.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_mix.c
@@ -217,8 +217,8 @@ static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
MixContext *s = ctx->priv;
- AVRational time_base = ctx->inputs[0]->time_base;
AVRational frame_rate = ctx->inputs[0]->frame_rate;
+ AVRational sar = ctx->inputs[0]->sample_aspect_ratio;
AVFilterLink *inlink = ctx->inputs[0];
int height = ctx->inputs[0]->h;
int width = ctx->inputs[0]->w;
@@ -252,8 +252,8 @@ static int config_output(AVFilterLink *outlink)
outlink->w = width;
outlink->h = height;
- outlink->time_base = time_base;
outlink->frame_rate = frame_rate;
+ outlink->sample_aspect_ratio = sar;
if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
return ret;
@@ -271,7 +271,10 @@ static int config_output(AVFilterLink *outlink)
in[i].after = (s->duration == 1 || (s->duration == 2 && i == 0)) ? EXT_STOP : EXT_INFINITY;
}
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static av_cold void uninit(AVFilterContext *ctx)
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_nlmeans_opencl.c b/chromium/third_party/ffmpeg/libavfilter/vf_nlmeans_opencl.c
new file mode 100644
index 00000000000..e57b5e08734
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_nlmeans_opencl.c
@@ -0,0 +1,443 @@
+/*
+ * 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 <float.h>
+
+#include "libavutil/avassert.h"
+#include "libavutil/common.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/mem.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+
+#include "avfilter.h"
+#include "internal.h"
+#include "opencl.h"
+#include "opencl_source.h"
+#include "video.h"
+
+// TODO:
+// the integral image may overflow 32bit, consider using 64bit
+
+static const enum AVPixelFormat supported_formats[] = {
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_GBRP,
+};
+
+static int is_format_supported(enum AVPixelFormat fmt)
+{
+ int i;
+
+ for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++)
+ if (supported_formats[i] == fmt)
+ return 1;
+ return 0;
+}
+
+typedef struct NLMeansOpenCLContext {
+ OpenCLFilterContext ocf;
+ int initialised;
+ cl_kernel vert_kernel;
+ cl_kernel horiz_kernel;
+ cl_kernel accum_kernel;
+ cl_kernel average_kernel;
+ cl_mem integral_img;
+ cl_mem weight;
+ cl_mem sum;
+ cl_mem overflow; // overflow in integral image?
+ double sigma;
+ float h;
+ int chroma_w;
+ int chroma_h;
+ int patch_size;
+ int patch_size_uv;
+ int research_size;
+ int research_size_uv;
+ cl_command_queue command_queue;
+} NLMeansOpenCLContext;
+
+static int nlmeans_opencl_init(AVFilterContext *avctx, int width, int height)
+{
+ NLMeansOpenCLContext *ctx = avctx->priv;
+ cl_int cle;
+ int err;
+ int weight_buf_size = width * height * sizeof(float);
+
+ ctx->h = ctx->sigma * 10;
+ if (!(ctx->research_size & 1)) {
+ ctx->research_size |= 1;
+ av_log(avctx, AV_LOG_WARNING,
+ "research_size should be odd, set to %d",
+ ctx->research_size);
+ }
+
+ if (!(ctx->patch_size & 1)) {
+ ctx->patch_size |= 1;
+ av_log(avctx, AV_LOG_WARNING,
+ "patch_size should be odd, set to %d",
+ ctx->patch_size);
+ }
+
+ if (!ctx->research_size_uv)
+ ctx->research_size_uv = ctx->research_size;
+ if (!ctx->patch_size_uv)
+ ctx->patch_size_uv = ctx->patch_size;
+
+ err = ff_opencl_filter_load_program(avctx, &ff_opencl_source_nlmeans, 1);
+ if (err < 0)
+ goto fail;
+
+ ctx->command_queue = clCreateCommandQueue(ctx->ocf.hwctx->context,
+ ctx->ocf.hwctx->device_id,
+ 0, &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create OpenCL "
+ "command queue %d.\n", cle);
+
+ ctx->vert_kernel = clCreateKernel(ctx->ocf.program,
+ "vert_sum", &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "vert_sum kernel %d.\n", cle);
+
+ ctx->horiz_kernel = clCreateKernel(ctx->ocf.program,
+ "horiz_sum", &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "horiz_sum kernel %d.\n", cle);
+
+ ctx->accum_kernel = clCreateKernel(ctx->ocf.program,
+ "weight_accum", &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "accum kernel %d.\n", cle);
+
+ ctx->average_kernel = clCreateKernel(ctx->ocf.program,
+ "average", &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "average kernel %d.\n", cle);
+
+ ctx->integral_img = clCreateBuffer(ctx->ocf.hwctx->context, 0,
+ 4 * width * height * sizeof(cl_int),
+ NULL, &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "integral image %d.\n", cle);
+
+ ctx->weight = clCreateBuffer(ctx->ocf.hwctx->context, 0,
+ weight_buf_size, NULL, &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "weight buffer %d.\n", cle);
+
+ ctx->sum = clCreateBuffer(ctx->ocf.hwctx->context, 0,
+ weight_buf_size, NULL, &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "sum buffer %d.\n", cle);
+
+ ctx->overflow = clCreateBuffer(ctx->ocf.hwctx->context, 0,
+ sizeof(cl_int), NULL, &cle);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "
+ "overflow buffer %d.\n", cle);
+
+ ctx->initialised = 1;
+ return 0;
+
+fail:
+ CL_RELEASE_KERNEL(ctx->vert_kernel);
+ CL_RELEASE_KERNEL(ctx->horiz_kernel);
+ CL_RELEASE_KERNEL(ctx->accum_kernel);
+ CL_RELEASE_KERNEL(ctx->average_kernel);
+
+ CL_RELEASE_MEMORY(ctx->integral_img);
+ CL_RELEASE_MEMORY(ctx->weight);
+ CL_RELEASE_MEMORY(ctx->sum);
+ CL_RELEASE_MEMORY(ctx->overflow);
+
+ CL_RELEASE_QUEUE(ctx->command_queue);
+ return err;
+}
+
+static int nlmeans_plane(AVFilterContext *avctx, cl_mem dst, cl_mem src,
+ cl_int width, cl_int height, cl_int p, cl_int r)
+{
+ NLMeansOpenCLContext *ctx = avctx->priv;
+ const float zero = 0.0f;
+ const size_t worksize1[] = {height};
+ const size_t worksize2[] = {width};
+ const size_t worksize3[2] = {width, height};
+ int i, dx, dy, err = 0, weight_buf_size;
+ cl_int cle;
+ int nb_pixel, *tmp = NULL, idx = 0;
+ cl_int *dxdy = NULL;
+
+ weight_buf_size = width * height * sizeof(float);
+ cle = clEnqueueFillBuffer(ctx->command_queue, ctx->weight,
+ &zero, sizeof(float), 0, weight_buf_size,
+ 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to fill weight buffer: %d.\n",
+ cle);
+ cle = clEnqueueFillBuffer(ctx->command_queue, ctx->sum,
+ &zero, sizeof(float), 0, weight_buf_size,
+ 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to fill sum buffer: %d.\n",
+ cle);
+
+ nb_pixel = (2 * r + 1) * (2 * r + 1) - 1;
+ dxdy = av_malloc(nb_pixel * 2 * sizeof(cl_int));
+ tmp = av_malloc(nb_pixel * 2 * sizeof(int));
+
+ if (!dxdy || !tmp)
+ goto fail;
+
+ for (dx = -r; dx <= r; dx++) {
+ for (dy = -r; dy <= r; dy++) {
+ if (dx || dy) {
+ tmp[idx++] = dx;
+ tmp[idx++] = dy;
+ }
+ }
+ }
+ // repack dx/dy seperately, as we want to do four pairs of dx/dy in a batch
+ for (i = 0; i < nb_pixel / 4; i++) {
+ dxdy[i * 8] = tmp[i * 8]; // dx0
+ dxdy[i * 8 + 1] = tmp[i * 8 + 2]; // dx1
+ dxdy[i * 8 + 2] = tmp[i * 8 + 4]; // dx2
+ dxdy[i * 8 + 3] = tmp[i * 8 + 6]; // dx3
+ dxdy[i * 8 + 4] = tmp[i * 8 + 1]; // dy0
+ dxdy[i * 8 + 5] = tmp[i * 8 + 3]; // dy1
+ dxdy[i * 8 + 6] = tmp[i * 8 + 5]; // dy2
+ dxdy[i * 8 + 7] = tmp[i * 8 + 7]; // dy3
+ }
+ av_freep(&tmp);
+
+ for (i = 0; i < nb_pixel / 4; i++) {
+ cl_int *dx_cur = dxdy + 8 * i;
+ cl_int *dy_cur = dxdy + 8 * i + 4;
+
+ // horizontal pass
+ // integral(x,y) = sum([u(v,y) - u(v+dx,y+dy)]^2) for v in [0, x]
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 0, cl_mem, &ctx->integral_img);
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 1, cl_mem, &src);
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 2, cl_int, &width);
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 3, cl_int, &height);
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 4, cl_int4, dx_cur);
+ CL_SET_KERNEL_ARG(ctx->horiz_kernel, 5, cl_int4, dy_cur);
+ cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->horiz_kernel, 1,
+ NULL, worksize1, NULL, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue horiz_kernel: %d.\n",
+ cle);
+ // vertical pass
+ // integral(x, y) = sum(integral(x, v)) for v in [0, y]
+ CL_SET_KERNEL_ARG(ctx->vert_kernel, 0, cl_mem, &ctx->integral_img);
+ CL_SET_KERNEL_ARG(ctx->vert_kernel, 1, cl_mem, &ctx->overflow);
+ CL_SET_KERNEL_ARG(ctx->vert_kernel, 2, cl_int, &width);
+ CL_SET_KERNEL_ARG(ctx->vert_kernel, 3, cl_int, &height);
+ cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->vert_kernel,
+ 1, NULL, worksize2, NULL, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue vert_kernel: %d.\n",
+ cle);
+
+ // accumulate weights
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 0, cl_mem, &ctx->sum);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 1, cl_mem, &ctx->weight);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 2, cl_mem, &ctx->integral_img);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 3, cl_mem, &src);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 4, cl_int, &width);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 5, cl_int, &height);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 6, cl_int, &p);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 7, cl_float, &ctx->h);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 8, cl_int4, dx_cur);
+ CL_SET_KERNEL_ARG(ctx->accum_kernel, 9, cl_int4, dy_cur);
+ cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->accum_kernel,
+ 2, NULL, worksize3, NULL, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue kernel: %d.\n", cle);
+ }
+ av_freep(&dxdy);
+
+ // average
+ CL_SET_KERNEL_ARG(ctx->average_kernel, 0, cl_mem, &dst);
+ CL_SET_KERNEL_ARG(ctx->average_kernel, 1, cl_mem, &src);
+ CL_SET_KERNEL_ARG(ctx->average_kernel, 2, cl_mem, &ctx->sum);
+ CL_SET_KERNEL_ARG(ctx->average_kernel, 3, cl_mem, &ctx->weight);
+ cle = clEnqueueNDRangeKernel(ctx->command_queue, ctx->average_kernel, 2,
+ NULL, worksize3, NULL, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue average kernel: %d.\n",
+ cle);
+ cle = clFlush(ctx->command_queue);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to flush command queue: %d.\n", cle);
+fail:
+ if (tmp)
+ av_freep(&tmp);
+ if (dxdy)
+ av_freep(&dxdy);
+ return err;
+}
+
+static int nlmeans_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
+{
+ AVFilterContext *avctx = inlink->dst;
+ AVFilterLink *outlink = avctx->outputs[0];
+ NLMeansOpenCLContext *ctx = avctx->priv;
+ AVFrame *output = NULL;
+ AVHWFramesContext *input_frames_ctx;
+ const AVPixFmtDescriptor *desc;
+ enum AVPixelFormat in_format;
+ cl_mem src, dst;
+ const cl_int zero = 0;
+ int w, h, err, cle, overflow, p, patch, research;
+
+ av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
+ av_get_pix_fmt_name(input->format),
+ input->width, input->height, input->pts);
+
+ if (!input->hw_frames_ctx)
+ return AVERROR(EINVAL);
+ input_frames_ctx = (AVHWFramesContext*)input->hw_frames_ctx->data;
+ in_format = input_frames_ctx->sw_format;
+
+ output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!output) {
+ err = AVERROR(ENOMEM);
+ goto fail;
+ }
+
+ err = av_frame_copy_props(output, input);
+ if (err < 0)
+ goto fail;
+
+ if (!ctx->initialised) {
+ desc = av_pix_fmt_desc_get(in_format);
+ if (!is_format_supported(in_format)) {
+ err = AVERROR(EINVAL);
+ av_log(avctx, AV_LOG_ERROR, "input format %s not supported\n",
+ av_get_pix_fmt_name(in_format));
+ goto fail;
+ }
+ ctx->chroma_w = AV_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
+ ctx->chroma_h = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
+
+ err = nlmeans_opencl_init(avctx, inlink->w, inlink->h);
+ if (err < 0)
+ goto fail;
+ }
+
+ cle = clEnqueueWriteBuffer(ctx->command_queue, ctx->overflow, CL_FALSE,
+ 0, sizeof(cl_int), &zero, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to initialize overflow"
+ "detection buffer %d.\n", cle);
+
+ for (p = 0; p < FF_ARRAY_ELEMS(output->data); p++) {
+ src = (cl_mem) input->data[p];
+ dst = (cl_mem) output->data[p];
+
+ if (!dst)
+ break;
+ av_assert0(src);
+ w = p ? ctx->chroma_w : inlink->w;
+ h = p ? ctx->chroma_h : inlink->h;
+ patch = (p ? ctx->patch_size_uv : ctx->patch_size) / 2;
+ research = (p ? ctx->research_size_uv : ctx->research_size) / 2;
+ err = nlmeans_plane(avctx, dst, src, w, h, patch, research);
+ if (err < 0)
+ goto fail;
+ }
+ // overflow occurred?
+ cle = clEnqueueReadBuffer(ctx->command_queue, ctx->overflow, CL_FALSE,
+ 0, sizeof(cl_int), &overflow, 0, NULL, NULL);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to read overflow: %d.\n", cle);
+
+ cle = clFinish(ctx->command_queue);
+ CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to finish kernel: %d.\n", cle);
+
+ if (overflow > 0)
+ av_log(avctx, AV_LOG_ERROR, "integral image overflow %d\n", overflow);
+
+ av_frame_free(&input);
+
+ av_log(ctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
+ av_get_pix_fmt_name(output->format),
+ output->width, output->height, output->pts);
+
+ return ff_filter_frame(outlink, output);
+
+fail:
+ clFinish(ctx->command_queue);
+ av_frame_free(&input);
+ av_frame_free(&output);
+ return err;
+}
+
+static av_cold void nlmeans_opencl_uninit(AVFilterContext *avctx)
+{
+ NLMeansOpenCLContext *ctx = avctx->priv;
+ cl_int cle;
+
+ CL_RELEASE_KERNEL(ctx->vert_kernel);
+ CL_RELEASE_KERNEL(ctx->horiz_kernel);
+ CL_RELEASE_KERNEL(ctx->accum_kernel);
+ CL_RELEASE_KERNEL(ctx->average_kernel);
+
+ CL_RELEASE_MEMORY(ctx->integral_img);
+ CL_RELEASE_MEMORY(ctx->weight);
+ CL_RELEASE_MEMORY(ctx->sum);
+ CL_RELEASE_MEMORY(ctx->overflow);
+
+ CL_RELEASE_QUEUE(ctx->command_queue);
+
+ ff_opencl_filter_uninit(avctx);
+}
+
+#define OFFSET(x) offsetof(NLMeansOpenCLContext, x)
+#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
+static const AVOption nlmeans_opencl_options[] = {
+ { "s", "denoising strength", OFFSET(sigma), AV_OPT_TYPE_DOUBLE, { .dbl = 1.0 }, 1.0, 30.0, FLAGS },
+ { "p", "patch size", OFFSET(patch_size), AV_OPT_TYPE_INT, { .i64 = 2*3+1 }, 0, 99, FLAGS },
+ { "pc", "patch size for chroma planes", OFFSET(patch_size_uv), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 99, FLAGS },
+ { "r", "research window", OFFSET(research_size), AV_OPT_TYPE_INT, { .i64 = 7*2+1 }, 0, 99, FLAGS },
+ { "rc", "research window for chroma planes", OFFSET(research_size_uv), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 99, FLAGS },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(nlmeans_opencl);
+
+static const AVFilterPad nlmeans_opencl_inputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .filter_frame = &nlmeans_opencl_filter_frame,
+ .config_props = &ff_opencl_filter_config_input,
+ },
+ { NULL }
+};
+
+static const AVFilterPad nlmeans_opencl_outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = &ff_opencl_filter_config_output,
+ },
+ { NULL }
+};
+
+AVFilter ff_vf_nlmeans_opencl = {
+ .name = "nlmeans_opencl",
+ .description = NULL_IF_CONFIG_SMALL("Non-local means denoiser through OpenCL"),
+ .priv_size = sizeof(NLMeansOpenCLContext),
+ .priv_class = &nlmeans_opencl_class,
+ .init = &ff_opencl_filter_init,
+ .uninit = &nlmeans_opencl_uninit,
+ .query_formats = &ff_opencl_filter_query_formats,
+ .inputs = nlmeans_opencl_inputs,
+ .outputs = nlmeans_opencl_outputs,
+ .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_normalize.c b/chromium/third_party/ffmpeg/libavfilter/vf_normalize.c
index 5c1fe98c60c..48eea59e64c 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_normalize.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_normalize.c
@@ -76,6 +76,7 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
@@ -90,8 +91,9 @@ typedef struct NormalizeContext {
float independence;
float strength;
- int co[4]; // Offsets to R,G,B,A bytes respectively in each pixel
+ uint8_t co[4]; // Offsets to R,G,B,A bytes respectively in each pixel
int num_components; // Number of components in the pixel format
+ int step;
int history_len; // Number of frames to average; based on smoothing factor
int frame_num; // Increments on each frame, starting from 0.
@@ -147,8 +149,8 @@ static void normalize(NormalizeContext *s, AVFrame *in, AVFrame *out)
min[c].in = FFMIN(min[c].in, inp[s->co[c]]);
max[c].in = FFMAX(max[c].in, inp[s->co[c]]);
}
- inp += s->num_components;
- outp += s->num_components;
+ inp += s->step;
+ outp += s->step;
}
}
@@ -237,8 +239,8 @@ static void normalize(NormalizeContext *s, AVFrame *in, AVFrame *out)
if (s->num_components == 4)
// Copy alpha as-is.
outp[s->co[3]] = inp[s->co[3]];
- inp += s->num_components;
- outp += s->num_components;
+ inp += s->step;
+ outp += s->step;
}
}
@@ -286,9 +288,9 @@ static int config_input(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
int c;
- for (c = 0; c < 4; ++c)
- s->co[c] = desc->comp[c].offset;
+ ff_fill_rgba_map(s->co, inlink->format);
s->num_components = desc->nb_components;
+ s->step = av_get_padded_bits_per_pixel(desc) >> 3;
// Convert smoothing value to history_len (a count of frames to average,
// must be at least 1). Currently this is a direct assignment, but the
// smoothing value was originally envisaged as a number of seconds. In
@@ -383,4 +385,5 @@ AVFilter ff_vf_normalize = {
.query_formats = query_formats,
.inputs = inputs,
.outputs = outputs,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c b/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c
index abfff494387..d5f76059b79 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_ocr.c
@@ -100,11 +100,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFilterLink *outlink = ctx->outputs[0];
OCRContext *s = ctx->priv;
char *result;
+ int *confs;
result = TessBaseAPIRect(s->tess, in->data[0], 1,
in->linesize[0], 0, 0, in->width, in->height);
+ confs = TessBaseAPIAllWordConfidences(s->tess);
av_dict_set(metadata, "lavfi.ocr.text", result, 0);
+ for (int i = 0; confs[i] != -1; i++) {
+ char number[256];
+
+ snprintf(number, sizeof(number), "%d ", confs[i]);
+ av_dict_set(metadata, "lavfi.ocr.confidence", number, AV_DICT_APPEND);
+ }
+
TessDeleteText(result);
+ TessDeleteIntArray(confs);
return ff_filter_frame(outlink, in);
}
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_overlay_qsv.c b/chromium/third_party/ffmpeg/libavfilter/vf_overlay_qsv.c
index 9aabb594ba9..2a4dc5cb58d 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_overlay_qsv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_overlay_qsv.c
@@ -345,7 +345,7 @@ static int overlay_qsv_init(AVFilterContext *ctx)
return 0;
}
-static void overlay_qsv_uninit(AVFilterContext *ctx)
+static av_cold void overlay_qsv_uninit(AVFilterContext *ctx)
{
QSVOverlayContext *vpp = ctx->priv;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_procamp_vaapi.c b/chromium/third_party/ffmpeg/libavfilter/vf_procamp_vaapi.c
index 46f3ab6465a..c3e9866f227 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_procamp_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_procamp_vaapi.c
@@ -131,9 +131,7 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
AVFilterLink *outlink = avctx->outputs[0];
VAAPIVPPContext *vpp_ctx = avctx->priv;
AVFrame *output_frame = NULL;
- VASurfaceID input_surface, output_surface;
VAProcPipelineParameterBuffer params;
- VARectangle input_region;
int err;
av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
@@ -143,10 +141,6 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
if (vpp_ctx->va_context == VA_INVALID_ID)
return AVERROR(EINVAL);
- input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for procamp input.\n",
- input_surface);
-
output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
vpp_ctx->output_height);
if (!output_frame) {
@@ -154,39 +148,22 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
goto fail;
}
- output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for procamp output.\n",
- output_surface);
- memset(&params, 0, sizeof(params));
- input_region = (VARectangle) {
- .x = 0,
- .y = 0,
- .width = input_frame->width,
- .height = input_frame->height,
- };
-
- params.surface = input_surface;
- params.surface_region = &input_region;
- params.surface_color_standard =
- ff_vaapi_vpp_colour_standard(input_frame->colorspace);
-
- params.output_region = NULL;
- params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
- params.output_color_standard = params.surface_color_standard;
-
- params.pipeline_flags = 0;
- params.filter_flags = VA_FRAME_PICTURE;
+ err = av_frame_copy_props(output_frame, input_frame);
+ if (err < 0)
+ return err;
+
+ err = ff_vaapi_vpp_init_params(avctx, &params,
+ input_frame, output_frame);
+ if (err < 0)
+ goto fail;
params.filters = &vpp_ctx->filter_buffers[0];
params.num_filters = 1;
- err = ff_vaapi_vpp_render_picture(avctx, &params, output_surface);
+ err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
if (err < 0)
goto fail;
- err = av_frame_copy_props(output_frame, input_frame);
- if (err < 0)
- goto fail;
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_readeia608.c b/chromium/third_party/ffmpeg/libavfilter/vf_readeia608.c
index bc3abe7c4d2..27a0c583216 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_readeia608.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_readeia608.c
@@ -51,6 +51,8 @@ typedef struct ReadEIA608Context {
int black;
float mpd, mhd, msd, mac, spw, bhd, wth, bth;
int chp;
+ int lp;
+ uint8_t *temp;
} ReadEIA608Context;
#define OFFSET(x) offsetof(ReadEIA608Context, x)
@@ -68,6 +70,7 @@ static const AVOption readeia608_options[] = {
{ "th_w", "set white color threshold", OFFSET(wth), AV_OPT_TYPE_FLOAT, {.dbl=.35}, 0.1, 1, FLAGS },
{ "th_b", "set black color threshold", OFFSET(bth), AV_OPT_TYPE_FLOAT, {.dbl=.15}, 0, 0.5, FLAGS },
{ "chp", "check and apply parity bit", OFFSET(chp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
+ { "lp", "lowpass line prior to processing", OFFSET(lp), AV_OPT_TYPE_BOOL, {.i64= 0}, 0, 1, FLAGS },
{ NULL }
};
@@ -114,6 +117,9 @@ static int config_input(AVFilterLink *inlink)
s->max_start_diff = s->msd * ((1 << depth) - 1);
s->white = s->wth * ((1 << depth) - 1);
s->black = s->bth * ((1 << depth) - 1);
+ s->temp = av_calloc(inlink->w, sizeof(*s->temp));
+ if (!s->temp)
+ return AVERROR(ENOMEM);
return 0;
}
@@ -132,6 +138,25 @@ static void extract_line(AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in
int s1, s2, s3, parity;
src = &in->data[0][line * in->linesize[0]];
+
+ if (s->lp) {
+ uint8_t *dst = s->temp;
+ int w = inlink->w - 1;
+
+ for (i = 0; i < inlink->w; i++) {
+ int a = FFMAX(i - 3, 0);
+ int b = FFMAX(i - 2, 0);
+ int c = FFMAX(i - 1, 0);
+ int d = FFMIN(i + 3, w);
+ int e = FFMIN(i + 2, w);
+ int f = FFMIN(i + 1, w);
+
+ dst[i] = (src[a] + src[b] + src[c] + src[i] + src[d] + src[e] + src[f] + 6) / 7;
+ }
+
+ src = s->temp;
+ }
+
for (i = 0; i < sync_width; i++) {
max = FFMAX(max, src[i]);
min = FFMIN(min, src[i]);
@@ -163,14 +188,18 @@ static void extract_line(AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in
last = Y;
}
- if (peaks != 7)
+ if (peaks != 7) {
+ av_log(ctx, AV_LOG_DEBUG, "peaks: %d != 7\n", peaks);
return;
+ }
for (i = 1; i < 7; i++)
max_peak_diff = FFMAX(max_peak_diff, FFABS(clock[i][0] - clock[i-1][0]));
- if (max_peak_diff > s->max_peak_diff)
+ if (max_peak_diff > s->max_peak_diff) {
+ av_log(ctx, AV_LOG_DEBUG, "mhd: %d > %d\n", max_peak_diff, s->max_peak_diff);
return;
+ }
max = 0; min = INT_MAX;
for (i = 1; i < 7; i++) {
@@ -179,15 +208,19 @@ static void extract_line(AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in
}
range = max - min;
- if (range > s->max_period_diff)
+ if (range > s->max_period_diff) {
+ av_log(ctx, AV_LOG_DEBUG, "mpd: %d > %d\n", range, s->max_period_diff);
return;
+ }
s1 = src[sync_width + width_per_bit * 0 + width_per_bit / 2];
s2 = src[sync_width + width_per_bit * 1 + width_per_bit / 2];
s3 = src[sync_width + width_per_bit * 2 + width_per_bit / 2];
- if (FFABS(s1 - s2) > s->max_start_diff || s1 > s->black || s2 > s->black || s3 < s->white)
+ if (FFABS(s1 - s2) > s->max_start_diff || s1 > s->black || s2 > s->black || s3 < s->white) {
+ av_log(ctx, AV_LOG_DEBUG, "msd: %d > %d\n", FFABS(s1 - s2), s->max_start_diff);
return;
+ }
for (ch = 0; ch < 2; ch++) {
for (parity = 0, i = 0; i < 8; i++) {
@@ -238,6 +271,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(outlink, in);
}
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ ReadEIA608Context *s = ctx->priv;
+
+ av_freep(&s->temp);
+}
+
static const AVFilterPad readeia608_inputs[] = {
{
.name = "default",
@@ -264,5 +304,6 @@ AVFilter ff_vf_readeia608 = {
.query_formats = query_formats,
.inputs = readeia608_inputs,
.outputs = readeia608_outputs,
+ .uninit = uninit,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
index f741419e7e2..7aebf56ad8a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale.c
@@ -572,8 +572,16 @@ static const AVOption scale_options[] = {
{ "interl", "set interlacing", OFFSET(interlaced), AV_OPT_TYPE_BOOL, {.i64 = 0 }, -1, 1, FLAGS },
{ "size", "set video size", OFFSET(size_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, FLAGS },
{ "s", "set video size", OFFSET(size_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, FLAGS },
- { "in_color_matrix", "set input YCbCr type", OFFSET(in_color_matrix), AV_OPT_TYPE_STRING, { .str = "auto" }, .flags = FLAGS },
- { "out_color_matrix", "set output YCbCr type", OFFSET(out_color_matrix), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
+ { "in_color_matrix", "set input YCbCr type", OFFSET(in_color_matrix), AV_OPT_TYPE_STRING, { .str = "auto" }, .flags = FLAGS, "color" },
+ { "out_color_matrix", "set output YCbCr type", OFFSET(out_color_matrix), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS, "color"},
+ { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .str = "auto" }, 0, 0, FLAGS, "color" },
+ { "bt601", NULL, 0, AV_OPT_TYPE_CONST, { .str = "bt601" }, 0, 0, FLAGS, "color" },
+ { "bt470", NULL, 0, AV_OPT_TYPE_CONST, { .str = "bt470" }, 0, 0, FLAGS, "color" },
+ { "smpte170m", NULL, 0, AV_OPT_TYPE_CONST, { .str = "smpte170m" }, 0, 0, FLAGS, "color" },
+ { "bt709", NULL, 0, AV_OPT_TYPE_CONST, { .str = "bt709" }, 0, 0, FLAGS, "color" },
+ { "fcc", NULL, 0, AV_OPT_TYPE_CONST, { .str = "fcc" }, 0, 0, FLAGS, "color" },
+ { "smpte240m", NULL, 0, AV_OPT_TYPE_CONST, { .str = "smpte240m" }, 0, 0, FLAGS, "color" },
+ { "bt2020", NULL, 0, AV_OPT_TYPE_CONST, { .str = "bt2020" }, 0, 0, FLAGS, "color" },
{ "in_range", "set input color range", OFFSET( in_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED }, 0, 2, FLAGS, "range" },
{ "out_range", "set output color range", OFFSET(out_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED }, 0, 2, FLAGS, "range" },
{ "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, 0, 0, FLAGS, "range" },
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale_cuda.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale_cuda.c
index c97a802ddc6..0a73ea14228 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale_cuda.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale_cuda.c
@@ -43,7 +43,8 @@ static const enum AVPixelFormat supported_formats[] = {
AV_PIX_FMT_NV12,
AV_PIX_FMT_YUV444P,
AV_PIX_FMT_P010,
- AV_PIX_FMT_P016
+ AV_PIX_FMT_P016,
+ AV_PIX_FMT_YUV444P16,
};
#define DIV_UP(a, b) ( ((a) + (b) - 1) / (b) )
@@ -357,7 +358,7 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel
.res.pitch2D.numChannels = channels,
.res.pitch2D.width = src_width,
.res.pitch2D.height = src_height,
- .res.pitch2D.pitchInBytes = src_pitch,
+ .res.pitch2D.pitchInBytes = src_pitch * pixel_size,
.res.pitch2D.devPtr = (CUdeviceptr)src_dptr,
};
@@ -389,12 +390,12 @@ static int scalecuda_resize(AVFilterContext *ctx,
out->data[0], out->width, out->height, out->linesize[0],
1);
call_resize_kernel(ctx, s->cu_func_uchar, 1,
- in->data[0]+in->linesize[0]*in->height, in->width/2, in->height/2, in->linesize[0]/2,
- out->data[0]+out->linesize[0]*out->height, out->width/2, out->height/2, out->linesize[0]/2,
+ in->data[1], in->width/2, in->height/2, in->linesize[0]/2,
+ out->data[1], out->width/2, out->height/2, out->linesize[0]/2,
1);
call_resize_kernel(ctx, s->cu_func_uchar, 1,
- in->data[0]+ ALIGN_UP((in->linesize[0]*in->height*5)/4, s->tex_alignment), in->width/2, in->height/2, in->linesize[0]/2,
- out->data[0]+(out->linesize[0]*out->height*5)/4, out->width/2, out->height/2, out->linesize[0]/2,
+ in->data[2], in->width/2, in->height/2, in->linesize[0]/2,
+ out->data[2], out->width/2, out->height/2, out->linesize[0]/2,
1);
break;
case AV_PIX_FMT_YUV444P:
@@ -403,14 +404,28 @@ static int scalecuda_resize(AVFilterContext *ctx,
out->data[0], out->width, out->height, out->linesize[0],
1);
call_resize_kernel(ctx, s->cu_func_uchar, 1,
- in->data[0]+in->linesize[0]*in->height, in->width, in->height, in->linesize[0],
- out->data[0]+out->linesize[0]*out->height, out->width, out->height, out->linesize[0],
+ in->data[1], in->width, in->height, in->linesize[0],
+ out->data[1], out->width, out->height, out->linesize[0],
1);
call_resize_kernel(ctx, s->cu_func_uchar, 1,
- in->data[0]+in->linesize[0]*in->height*2, in->width, in->height, in->linesize[0],
- out->data[0]+out->linesize[0]*out->height*2, out->width, out->height, out->linesize[0],
+ in->data[2], in->width, in->height, in->linesize[0],
+ out->data[2], out->width, out->height, out->linesize[0],
1);
break;
+ case AV_PIX_FMT_YUV444P16:
+ call_resize_kernel(ctx, s->cu_func_ushort, 1,
+ in->data[0], in->width, in->height, in->linesize[0] / 2,
+ out->data[0], out->width, out->height, out->linesize[0] / 2,
+ 2);
+ call_resize_kernel(ctx, s->cu_func_ushort, 1,
+ in->data[1], in->width, in->height, in->linesize[1] / 2,
+ out->data[1], out->width, out->height, out->linesize[1] / 2,
+ 2);
+ call_resize_kernel(ctx, s->cu_func_ushort, 1,
+ in->data[2], in->width, in->height, in->linesize[2] / 2,
+ out->data[2], out->width, out->height, out->linesize[2] / 2,
+ 2);
+ break;
case AV_PIX_FMT_NV12:
call_resize_kernel(ctx, s->cu_func_uchar, 1,
in->data[0], in->width, in->height, in->linesize[0],
@@ -418,7 +433,7 @@ static int scalecuda_resize(AVFilterContext *ctx,
1);
call_resize_kernel(ctx, s->cu_func_uchar2, 2,
in->data[1], in->width/2, in->height/2, in->linesize[1],
- out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width/2, out->height/2, out->linesize[1]/2,
+ out->data[1], out->width/2, out->height/2, out->linesize[1]/2,
1);
break;
case AV_PIX_FMT_P010LE:
@@ -428,7 +443,7 @@ static int scalecuda_resize(AVFilterContext *ctx,
2);
call_resize_kernel(ctx, s->cu_func_ushort2, 2,
in->data[1], in->width / 2, in->height / 2, in->linesize[1]/2,
- out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width / 2, out->height / 2, out->linesize[1] / 4,
+ out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 4,
2);
break;
case AV_PIX_FMT_P016LE:
@@ -438,7 +453,7 @@ static int scalecuda_resize(AVFilterContext *ctx,
2);
call_resize_kernel(ctx, s->cu_func_ushort2, 2,
in->data[1], in->width / 2, in->height / 2, in->linesize[1] / 2,
- out->data[0] + out->linesize[0] * ((out->height + 31) & ~0x1f), out->width / 2, out->height / 2, out->linesize[1] / 4,
+ out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 4,
2);
break;
default:
@@ -466,6 +481,9 @@ static int cudascale_scale(AVFilterContext *ctx, AVFrame *out, AVFrame *in)
av_frame_move_ref(out, s->frame);
av_frame_move_ref(s->frame, s->tmp_frame);
+ s->frame->width = s->planes_out[0].width;
+ s->frame->height = s->planes_out[0].height;
+
ret = av_frame_copy_props(out, in);
if (ret < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale_qsv.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale_qsv.c
index 7d593b2b211..499534e30d5 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale_qsv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale_qsv.c
@@ -69,6 +69,8 @@ enum var_name {
VARS_NB
};
+#define QSV_HAVE_SCALING_CONFIG QSV_VERSION_ATLEAST(1, 19)
+
typedef struct QSVScaleContext {
const AVClass *class;
@@ -88,7 +90,14 @@ typedef struct QSVScaleContext {
int nb_surface_ptrs_out;
mfxExtOpaqueSurfaceAlloc opaque_alloc;
- mfxExtBuffer *ext_buffers[1];
+
+#if QSV_HAVE_SCALING_CONFIG
+ mfxExtVPPScaling scale_conf;
+#endif
+ int mode;
+
+ mfxExtBuffer *ext_buffers[1 + QSV_HAVE_SCALING_CONFIG];
+ int num_ext_buf;
int shift_width, shift_height;
@@ -109,7 +118,7 @@ typedef struct QSVScaleContext {
char *format_str;
} QSVScaleContext;
-static int qsvscale_init(AVFilterContext *ctx)
+static av_cold int qsvscale_init(AVFilterContext *ctx)
{
QSVScaleContext *s = ctx->priv;
@@ -126,7 +135,7 @@ static int qsvscale_init(AVFilterContext *ctx)
return 0;
}
-static void qsvscale_uninit(AVFilterContext *ctx)
+static av_cold void qsvscale_uninit(AVFilterContext *ctx)
{
QSVScaleContext *s = ctx->priv;
@@ -285,6 +294,8 @@ static int init_out_session(AVFilterContext *ctx)
mfxStatus err;
int i;
+ s->num_ext_buf = 0;
+
/* extract the properties of the "master" session given to us */
err = MFXQueryIMPL(device_hwctx->session, &impl);
if (err == MFX_ERR_NONE)
@@ -357,10 +368,7 @@ static int init_out_session(AVFilterContext *ctx)
s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc);
- s->ext_buffers[0] = (mfxExtBuffer*)&s->opaque_alloc;
-
- par.ExtParam = s->ext_buffers;
- par.NumExtParam = FF_ARRAY_ELEMS(s->ext_buffers);
+ s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->opaque_alloc;
par.IOPattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
} else {
@@ -396,6 +404,18 @@ static int init_out_session(AVFilterContext *ctx)
par.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY;
}
+#if QSV_HAVE_SCALING_CONFIG
+ memset(&s->scale_conf, 0, sizeof(mfxExtVPPScaling));
+ s->scale_conf.Header.BufferId = MFX_EXTBUFF_VPP_SCALING;
+ s->scale_conf.Header.BufferSz = sizeof(mfxExtVPPScaling);
+ s->scale_conf.ScalingMode = s->mode;
+ s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->scale_conf;
+ av_log(ctx, AV_LOG_VERBOSE, "Scaling mode: %"PRIu16"\n", s->mode);
+#endif
+
+ par.ExtParam = s->ext_buffers;
+ par.NumExtParam = s->num_ext_buf;
+
par.AsyncDepth = 1; // TODO async
par.vpp.In = in_frames_hwctx->surfaces[0].Info;
@@ -595,6 +615,16 @@ static const AVOption options[] = {
{ "h", "Output video height", OFFSET(h_expr), AV_OPT_TYPE_STRING, { .str = "ih" }, .flags = FLAGS },
{ "format", "Output pixel format", OFFSET(format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
+#if QSV_HAVE_SCALING_CONFIG
+ { "mode", "set scaling mode", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT}, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, FLAGS, "mode"},
+ { "low_power", "low power mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "mode"},
+ { "hq", "high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_QUALITY}, INT_MIN, INT_MAX, FLAGS, "mode"},
+#else
+ { "mode", "(not supported)", OFFSET(mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, INT_MAX, FLAGS, "mode"},
+ { "low_power", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, FLAGS, "mode"},
+ { "hq", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, FLAGS, "mode"},
+#endif
+
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_scale_vaapi.c b/chromium/third_party/ffmpeg/libavfilter/vf_scale_vaapi.c
index 3699363140d..c32395ac09a 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_scale_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_scale_vaapi.c
@@ -39,6 +39,17 @@ typedef struct ScaleVAAPIContext {
char *w_expr; // width expression string
char *h_expr; // height expression string
+
+ char *colour_primaries_string;
+ char *colour_transfer_string;
+ char *colour_matrix_string;
+ int colour_range;
+ char *chroma_location_string;
+
+ enum AVColorPrimaries colour_primaries;
+ enum AVColorTransferCharacteristic colour_transfer;
+ enum AVColorSpace colour_matrix;
+ enum AVChromaLocation chroma_location;
} ScaleVAAPIContext;
static const char *scale_vaapi_mode_name(int mode)
@@ -89,9 +100,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
VAAPIVPPContext *vpp_ctx = avctx->priv;
ScaleVAAPIContext *ctx = avctx->priv;
AVFrame *output_frame = NULL;
- VASurfaceID input_surface, output_surface;
VAProcPipelineParameterBuffer params;
- VARectangle input_region;
int err;
av_log(avctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
@@ -101,10 +110,6 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
if (vpp_ctx->va_context == VA_INVALID_ID)
return AVERROR(EINVAL);
- input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for scale input.\n",
- input_surface);
-
output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
vpp_ctx->output_height);
if (!output_frame) {
@@ -112,38 +117,29 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail;
}
- output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for scale output.\n",
- output_surface);
-
- memset(&params, 0, sizeof(params));
-
- input_region = (VARectangle) {
- .x = input_frame->crop_left,
- .y = input_frame->crop_top,
- .width = input_frame->width -
- (input_frame->crop_left + input_frame->crop_right),
- .height = input_frame->height -
- (input_frame->crop_top + input_frame->crop_bottom),
- };
-
- params.surface = input_surface;
- params.surface_region = &input_region;
- params.surface_color_standard =
- ff_vaapi_vpp_colour_standard(input_frame->colorspace);
-
- params.output_region = 0;
- params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
- params.output_color_standard = params.surface_color_standard;
-
- params.pipeline_flags = 0;
- params.filter_flags = ctx->mode;
+ err = av_frame_copy_props(output_frame, input_frame);
+ if (err < 0)
+ return err;
- err = ff_vaapi_vpp_render_picture(avctx, &params, output_surface);
+ if (ctx->colour_primaries != AVCOL_PRI_UNSPECIFIED)
+ output_frame->color_primaries = ctx->colour_primaries;
+ if (ctx->colour_transfer != AVCOL_TRC_UNSPECIFIED)
+ output_frame->color_trc = ctx->colour_transfer;
+ if (ctx->colour_matrix != AVCOL_SPC_UNSPECIFIED)
+ output_frame->colorspace = ctx->colour_matrix;
+ if (ctx->colour_range != AVCOL_RANGE_UNSPECIFIED)
+ output_frame->color_range = ctx->colour_range;
+ if (ctx->chroma_location != AVCHROMA_LOC_UNSPECIFIED)
+ output_frame->chroma_location = ctx->chroma_location;
+
+ err = ff_vaapi_vpp_init_params(avctx, &params,
+ input_frame, output_frame);
if (err < 0)
goto fail;
- err = av_frame_copy_props(output_frame, input_frame);
+ params.filter_flags |= ctx->mode;
+
+ err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
if (err < 0)
goto fail;
@@ -181,6 +177,24 @@ static av_cold int scale_vaapi_init(AVFilterContext *avctx)
vpp_ctx->output_format = AV_PIX_FMT_NONE;
}
+#define STRING_OPTION(var_name, func_name, default_value) do { \
+ if (ctx->var_name ## _string) { \
+ int var = av_ ## func_name ## _from_name(ctx->var_name ## _string); \
+ if (var < 0) { \
+ av_log(avctx, AV_LOG_ERROR, "Invalid %s.\n", #var_name); \
+ return AVERROR(EINVAL); \
+ } \
+ ctx->var_name = var; \
+ } else { \
+ ctx->var_name = default_value; \
+ } \
+ } while (0)
+
+ STRING_OPTION(colour_primaries, color_primaries, AVCOL_PRI_UNSPECIFIED);
+ STRING_OPTION(colour_transfer, color_transfer, AVCOL_TRC_UNSPECIFIED);
+ STRING_OPTION(colour_matrix, color_space, AVCOL_SPC_UNSPECIFIED);
+ STRING_OPTION(chroma_location, chroma_location, AVCHROMA_LOC_UNSPECIFIED);
+
return 0;
}
@@ -204,6 +218,36 @@ static const AVOption scale_vaapi_options[] = {
0, AV_OPT_TYPE_CONST, { .i64 = VA_FILTER_SCALING_HQ }, 0, 0, FLAGS, "mode" },
{ "nl_anamorphic", "Use nolinear anamorphic scaling algorithm",
0, AV_OPT_TYPE_CONST, { .i64 = VA_FILTER_SCALING_NL_ANAMORPHIC }, 0, 0, FLAGS, "mode" },
+
+ // These colour properties match the ones of the same name in vf_scale.
+ { "out_color_matrix", "Output colour matrix coefficient set",
+ OFFSET(colour_matrix_string), AV_OPT_TYPE_STRING, { .str = NULL }, .flags = FLAGS },
+ { "out_range", "Output colour range",
+ OFFSET(colour_range), AV_OPT_TYPE_INT, { .i64 = AVCOL_RANGE_UNSPECIFIED },
+ AVCOL_RANGE_UNSPECIFIED, AVCOL_RANGE_JPEG, FLAGS, "range" },
+ { "full", "Full range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, "range" },
+ { "limited", "Limited range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, "range" },
+ { "jpeg", "Full range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, "range" },
+ { "mpeg", "Limited range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, "range" },
+ { "tv", "Limited range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, "range" },
+ { "pc", "Full range",
+ 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, "range" },
+ // These colour properties are new here.
+ { "out_color_primaries", "Output colour primaries",
+ OFFSET(colour_primaries_string), AV_OPT_TYPE_STRING,
+ { .str = NULL }, .flags = FLAGS },
+ { "out_color_transfer", "Output colour transfer characteristics",
+ OFFSET(colour_transfer_string), AV_OPT_TYPE_STRING,
+ { .str = NULL }, .flags = FLAGS },
+ { "out_chroma_location", "Output chroma sample location",
+ OFFSET(chroma_location_string), AV_OPT_TYPE_STRING,
+ { .str = NULL }, .flags = FLAGS },
+
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c b/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
index 3ed222f271b..74ebd35bd14 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_separatefields.c
@@ -20,6 +20,7 @@
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "filters.h"
#include "internal.h"
typedef struct SeparateFieldsContext {
@@ -101,23 +102,53 @@ clone:
return ff_filter_frame(outlink, inpicref);
}
-static int request_frame(AVFilterLink *outlink)
+static int flush_frame(AVFilterLink *outlink, int64_t pts, int64_t *out_pts)
{
AVFilterContext *ctx = outlink->src;
SeparateFieldsContext *s = ctx->priv;
- int ret;
+ int ret = 0;
- ret = ff_request_frame(ctx->inputs[0]);
- if (ret == AVERROR_EOF && s->second) {
- s->second->pts *= 2;
+ if (s->second) {
+ *out_pts = s->second->pts += pts;
extract_field(s->second, s->nb_planes, s->second->top_field_first);
ret = ff_filter_frame(outlink, s->second);
- s->second = 0;
+ s->second = NULL;
}
return ret;
}
+static int activate(AVFilterContext *ctx)
+{
+ AVFilterLink *inlink = ctx->inputs[0];
+ AVFilterLink *outlink = ctx->outputs[0];
+ AVFrame *in;
+ int64_t pts;
+ int ret, status;
+
+ FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
+
+ ret = ff_inlink_consume_frame(inlink, &in);
+ if (ret < 0)
+ return ret;
+ if (ret > 0)
+ return filter_frame(inlink, in);
+
+ if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
+ if (status == AVERROR_EOF) {
+ int64_t out_pts = pts;
+
+ ret = flush_frame(outlink, pts, &out_pts);
+ ff_outlink_set_status(outlink, status, out_pts);
+ return ret;
+ }
+ }
+
+ FF_FILTER_FORWARD_WANTED(outlink, inlink);
+
+ return FFERROR_NOT_READY;
+}
+
static av_cold void uninit(AVFilterContext *ctx)
{
SeparateFieldsContext *s = ctx->priv;
@@ -129,7 +160,6 @@ static const AVFilterPad separatefields_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
- .filter_frame = filter_frame,
},
{ NULL }
};
@@ -139,7 +169,6 @@ static const AVFilterPad separatefields_outputs[] = {
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = config_props_output,
- .request_frame = request_frame,
},
{ NULL }
};
@@ -148,6 +177,7 @@ AVFilter ff_vf_separatefields = {
.name = "separatefields",
.description = NULL_IF_CONFIG_SMALL("Split input video frames into fields."),
.priv_size = sizeof(SeparateFieldsContext),
+ .activate = activate,
.uninit = uninit,
.inputs = separatefields_inputs,
.outputs = separatefields_outputs,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_sr.c b/chromium/third_party/ffmpeg/libavfilter/vf_sr.c
index 6423d2ea118..0433246e265 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_sr.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_sr.c
@@ -29,6 +29,7 @@
#include "formats.h"
#include "internal.h"
#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
#include "libavformat/avio.h"
#include "libswscale/swscale.h"
#include "dnn_interface.h"
@@ -40,7 +41,8 @@ typedef struct SRContext {
DNNBackendType backend_type;
DNNModule *dnn_module;
DNNModel *model;
- DNNData input, output;
+ DNNInputData input;
+ DNNData output;
int scale_factor;
struct SwsContext *sws_contexts[3];
int sws_slice_h, sws_input_linesize, sws_output_linesize;
@@ -49,7 +51,7 @@ typedef struct SRContext {
#define OFFSET(x) offsetof(SRContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static const AVOption sr_options[] = {
- { "dnn_backend", "DNN backend used for model execution", OFFSET(backend_type), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
+ { "dnn_backend", "DNN backend used for model execution", OFFSET(backend_type), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "backend" },
{ "native", "native backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "backend" },
#if (CONFIG_LIBTENSORFLOW == 1)
{ "tensorflow", "tensorflow backend flag", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "backend" },
@@ -70,23 +72,22 @@ static av_cold int init(AVFilterContext *context)
av_log(context, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
return AVERROR(ENOMEM);
}
+
if (!sr_context->model_filename){
av_log(context, AV_LOG_ERROR, "model file for network was not specified\n");
return AVERROR(EIO);
}
- else{
- if (!sr_context->dnn_module->load_model) {
- av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
- return AVERROR(EIO);
- } else {
- sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
- }
+ if (!sr_context->dnn_module->load_model) {
+ av_log(context, AV_LOG_ERROR, "load_model for network was not specified\n");
+ return AVERROR(EIO);
}
+ sr_context->model = (sr_context->dnn_module->load_model)(sr_context->model_filename);
if (!sr_context->model){
av_log(context, AV_LOG_ERROR, "could not load DNN model\n");
return AVERROR(EIO);
}
+ sr_context->input.dt = DNN_FLOAT;
sr_context->sws_contexts[0] = NULL;
sr_context->sws_contexts[1] = NULL;
sr_context->sws_contexts[2] = NULL;
@@ -117,98 +118,110 @@ static int config_props(AVFilterLink *inlink)
AVFilterLink *outlink = context->outputs[0];
DNNReturnType result;
int sws_src_h, sws_src_w, sws_dst_h, sws_dst_w;
+ const char *model_output_name = "y";
sr_context->input.width = inlink->w * sr_context->scale_factor;
sr_context->input.height = inlink->h * sr_context->scale_factor;
sr_context->input.channels = 1;
- result = (sr_context->model->set_input_output)(sr_context->model->model, &sr_context->input, &sr_context->output);
+ result = (sr_context->model->set_input_output)(sr_context->model->model, &sr_context->input, "x", &model_output_name, 1);
if (result != DNN_SUCCESS){
av_log(context, AV_LOG_ERROR, "could not set input and output for the model\n");
return AVERROR(EIO);
}
- else{
- if (sr_context->input.height != sr_context->output.height || sr_context->input.width != sr_context->output.width){
- sr_context->input.width = inlink->w;
- sr_context->input.height = inlink->h;
- result = (sr_context->model->set_input_output)(sr_context->model->model, &sr_context->input, &sr_context->output);
- if (result != DNN_SUCCESS){
- av_log(context, AV_LOG_ERROR, "could not set input and output for the model\n");
- return AVERROR(EIO);
- }
- sr_context->scale_factor = 0;
+
+ result = (sr_context->dnn_module->execute_model)(sr_context->model, &sr_context->output, 1);
+ if (result != DNN_SUCCESS){
+ av_log(context, AV_LOG_ERROR, "failed to execute loaded model\n");
+ return AVERROR(EIO);
+ }
+
+ if (sr_context->input.height != sr_context->output.height || sr_context->input.width != sr_context->output.width){
+ sr_context->input.width = inlink->w;
+ sr_context->input.height = inlink->h;
+ result = (sr_context->model->set_input_output)(sr_context->model->model, &sr_context->input, "x", &model_output_name, 1);
+ if (result != DNN_SUCCESS){
+ av_log(context, AV_LOG_ERROR, "could not set input and output for the model\n");
+ return AVERROR(EIO);
+ }
+ result = (sr_context->dnn_module->execute_model)(sr_context->model, &sr_context->output, 1);
+ if (result != DNN_SUCCESS){
+ av_log(context, AV_LOG_ERROR, "failed to execute loaded model\n");
+ return AVERROR(EIO);
}
- outlink->h = sr_context->output.height;
- outlink->w = sr_context->output.width;
- sr_context->sws_contexts[1] = sws_getContext(sr_context->input.width, sr_context->input.height, AV_PIX_FMT_GRAY8,
- sr_context->input.width, sr_context->input.height, AV_PIX_FMT_GRAYF32,
- 0, NULL, NULL, NULL);
- sr_context->sws_input_linesize = sr_context->input.width << 2;
- sr_context->sws_contexts[2] = sws_getContext(sr_context->output.width, sr_context->output.height, AV_PIX_FMT_GRAYF32,
- sr_context->output.width, sr_context->output.height, AV_PIX_FMT_GRAY8,
- 0, NULL, NULL, NULL);
- sr_context->sws_output_linesize = sr_context->output.width << 2;
- if (!sr_context->sws_contexts[1] || !sr_context->sws_contexts[2]){
- av_log(context, AV_LOG_ERROR, "could not create SwsContext for conversions\n");
+ sr_context->scale_factor = 0;
+ }
+ outlink->h = sr_context->output.height;
+ outlink->w = sr_context->output.width;
+ sr_context->sws_contexts[1] = sws_getContext(sr_context->input.width, sr_context->input.height, AV_PIX_FMT_GRAY8,
+ sr_context->input.width, sr_context->input.height, AV_PIX_FMT_GRAYF32,
+ 0, NULL, NULL, NULL);
+ sr_context->sws_input_linesize = sr_context->input.width << 2;
+ sr_context->sws_contexts[2] = sws_getContext(sr_context->output.width, sr_context->output.height, AV_PIX_FMT_GRAYF32,
+ sr_context->output.width, sr_context->output.height, AV_PIX_FMT_GRAY8,
+ 0, NULL, NULL, NULL);
+ sr_context->sws_output_linesize = sr_context->output.width << 2;
+ if (!sr_context->sws_contexts[1] || !sr_context->sws_contexts[2]){
+ av_log(context, AV_LOG_ERROR, "could not create SwsContext for conversions\n");
+ return AVERROR(ENOMEM);
+ }
+ if (sr_context->scale_factor){
+ sr_context->sws_contexts[0] = sws_getContext(inlink->w, inlink->h, inlink->format,
+ outlink->w, outlink->h, outlink->format,
+ SWS_BICUBIC, NULL, NULL, NULL);
+ if (!sr_context->sws_contexts[0]){
+ av_log(context, AV_LOG_ERROR, "could not create SwsContext for scaling\n");
return AVERROR(ENOMEM);
}
- if (sr_context->scale_factor){
- sr_context->sws_contexts[0] = sws_getContext(inlink->w, inlink->h, inlink->format,
- outlink->w, outlink->h, outlink->format,
+ sr_context->sws_slice_h = inlink->h;
+ } else {
+ if (inlink->format != AV_PIX_FMT_GRAY8){
+ sws_src_h = sr_context->input.height;
+ sws_src_w = sr_context->input.width;
+ sws_dst_h = sr_context->output.height;
+ sws_dst_w = sr_context->output.width;
+
+ switch (inlink->format){
+ case AV_PIX_FMT_YUV420P:
+ sws_src_h = AV_CEIL_RSHIFT(sws_src_h, 1);
+ sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 1);
+ sws_dst_h = AV_CEIL_RSHIFT(sws_dst_h, 1);
+ sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 1);
+ break;
+ case AV_PIX_FMT_YUV422P:
+ sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 1);
+ sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 1);
+ break;
+ case AV_PIX_FMT_YUV444P:
+ break;
+ case AV_PIX_FMT_YUV410P:
+ sws_src_h = AV_CEIL_RSHIFT(sws_src_h, 2);
+ sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 2);
+ sws_dst_h = AV_CEIL_RSHIFT(sws_dst_h, 2);
+ sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 2);
+ break;
+ case AV_PIX_FMT_YUV411P:
+ sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 2);
+ sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 2);
+ break;
+ default:
+ av_log(context, AV_LOG_ERROR,
+ "could not create SwsContext for scaling for given input pixel format: %s\n",
+ av_get_pix_fmt_name(inlink->format));
+ return AVERROR(EIO);
+ }
+ sr_context->sws_contexts[0] = sws_getContext(sws_src_w, sws_src_h, AV_PIX_FMT_GRAY8,
+ sws_dst_w, sws_dst_h, AV_PIX_FMT_GRAY8,
SWS_BICUBIC, NULL, NULL, NULL);
if (!sr_context->sws_contexts[0]){
av_log(context, AV_LOG_ERROR, "could not create SwsContext for scaling\n");
return AVERROR(ENOMEM);
}
- sr_context->sws_slice_h = inlink->h;
- }
- else{
- if (inlink->format != AV_PIX_FMT_GRAY8){
- sws_src_h = sr_context->input.height;
- sws_src_w = sr_context->input.width;
- sws_dst_h = sr_context->output.height;
- sws_dst_w = sr_context->output.width;
-
- switch (inlink->format){
- case AV_PIX_FMT_YUV420P:
- sws_src_h = AV_CEIL_RSHIFT(sws_src_h, 1);
- sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 1);
- sws_dst_h = AV_CEIL_RSHIFT(sws_dst_h, 1);
- sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 1);
- break;
- case AV_PIX_FMT_YUV422P:
- sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 1);
- sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 1);
- break;
- case AV_PIX_FMT_YUV444P:
- break;
- case AV_PIX_FMT_YUV410P:
- sws_src_h = AV_CEIL_RSHIFT(sws_src_h, 2);
- sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 2);
- sws_dst_h = AV_CEIL_RSHIFT(sws_dst_h, 2);
- sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 2);
- break;
- case AV_PIX_FMT_YUV411P:
- sws_src_w = AV_CEIL_RSHIFT(sws_src_w, 2);
- sws_dst_w = AV_CEIL_RSHIFT(sws_dst_w, 2);
- break;
- default:
- av_log(context, AV_LOG_ERROR, "could not create SwsContext for scaling for given input pixel format");
- return AVERROR(EIO);
- }
- sr_context->sws_contexts[0] = sws_getContext(sws_src_w, sws_src_h, AV_PIX_FMT_GRAY8,
- sws_dst_w, sws_dst_h, AV_PIX_FMT_GRAY8,
- SWS_BICUBIC, NULL, NULL, NULL);
- if (!sr_context->sws_contexts[0]){
- av_log(context, AV_LOG_ERROR, "could not create SwsContext for scaling\n");
- return AVERROR(ENOMEM);
- }
- sr_context->sws_slice_h = sws_src_h;
- }
+ sr_context->sws_slice_h = sws_src_h;
}
-
- return 0;
}
+
+ return 0;
}
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
@@ -234,8 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
sws_scale(sr_context->sws_contexts[1], (const uint8_t **)out->data, out->linesize,
0, out->height, (uint8_t * const*)(&sr_context->input.data),
(const int [4]){sr_context->sws_input_linesize, 0, 0, 0});
- }
- else{
+ } else {
if (sr_context->sws_contexts[0]){
sws_scale(sr_context->sws_contexts[0], (const uint8_t **)(in->data + 1), in->linesize + 1,
0, sr_context->sws_slice_h, out->data + 1, out->linesize + 1);
@@ -249,7 +261,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
}
av_frame_free(&in);
- dnn_result = (sr_context->dnn_module->execute_model)(sr_context->model);
+ dnn_result = (sr_context->dnn_module->execute_model)(sr_context->model, &sr_context->output, 1);
if (dnn_result != DNN_SUCCESS){
av_log(context, AV_LOG_ERROR, "failed to execute loaded model\n");
return AVERROR(EIO);
@@ -273,9 +285,7 @@ static av_cold void uninit(AVFilterContext *context)
}
for (i = 0; i < 3; ++i){
- if (sr_context->sws_contexts[i]){
- sws_freeContext(sr_context->sws_contexts[i]);
- }
+ sws_freeContext(sr_context->sws_contexts[i]);
}
}
@@ -307,6 +317,5 @@ AVFilter ff_vf_sr = {
.inputs = sr_inputs,
.outputs = sr_outputs,
.priv_class = &sr_class,
- .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
+ .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC,
};
-
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_stack.c b/chromium/third_party/ffmpeg/libavfilter/vf_stack.c
index 8731674aa71..4d254e00136 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_stack.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_stack.c
@@ -83,6 +83,17 @@ static av_cold int init(AVFilterContext *ctx)
return AVERROR(ENOMEM);
if (!strcmp(ctx->filter->name, "xstack")) {
+ if (!s->layout) {
+ if (s->nb_inputs == 2) {
+ s->layout = av_strdup("0_0|w0_0");
+ if (!s->layout)
+ return AVERROR(ENOMEM);
+ } else {
+ av_log(ctx, AV_LOG_ERROR, "No layout specified.\n");
+ return AVERROR(EINVAL);
+ }
+ }
+
s->items = av_calloc(s->nb_inputs, sizeof(*s->items));
if (!s->items)
return AVERROR(ENOMEM);
@@ -174,7 +185,6 @@ static int config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
StackContext *s = ctx->priv;
- AVRational time_base = ctx->inputs[0]->time_base;
AVRational frame_rate = ctx->inputs[0]->frame_rate;
AVRational sar = ctx->inputs[0]->sample_aspect_ratio;
int height = ctx->inputs[0]->h;
@@ -281,7 +291,6 @@ static int config_output(AVFilterLink *outlink)
outlink->w = width;
outlink->h = height;
- outlink->time_base = time_base;
outlink->frame_rate = frame_rate;
outlink->sample_aspect_ratio = sar;
@@ -301,7 +310,10 @@ static int config_output(AVFilterLink *outlink)
in[i].after = s->shortest ? EXT_STOP : EXT_INFINITY;
}
- return ff_framesync_configure(&s->fs);
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
}
static av_cold void uninit(AVFilterContext *ctx)
@@ -384,7 +396,7 @@ AVFilter ff_vf_vstack = {
static const AVOption xstack_options[] = {
{ "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=2}, 2, INT_MAX, .flags = FLAGS },
- { "layout", "set custom layout", OFFSET(layout), AV_OPT_TYPE_STRING, {.str="0_0|w0_0"}, 0, 0, .flags = FLAGS },
+ { "layout", "set custom layout", OFFSET(layout), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, .flags = FLAGS },
{ "shortest", "force termination when the shortest input terminates", OFFSET(shortest), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, .flags = FLAGS },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c b/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
index 22746ebfb18..fc5d11e0537 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_tinterlace.c
@@ -63,7 +63,7 @@ static const AVOption interlace_options[] = {
{ "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MODE_TFF}, 0, 1, FLAGS, "mode"},
{ "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_TFF}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
{ "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_BFF}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"},
- { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0, 2, 0, "flags" },
+ { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0, 2, FLAGS, "flags" },
{ "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_tonemap.c b/chromium/third_party/ffmpeg/libavfilter/vf_tonemap.c
index efd4af5466c..d1728c8513b 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_tonemap.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_tonemap.c
@@ -191,10 +191,36 @@ static void tonemap(TonemapContext *s, AVFrame *out, const AVFrame *in,
*b_out *= sig / sig_orig;
}
+typedef struct ThreadData {
+ AVFrame *in, *out;
+ const AVPixFmtDescriptor *desc;
+ double peak;
+} ThreadData;
+
+static int tonemap_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ TonemapContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame *in = td->in;
+ AVFrame *out = td->out;
+ const AVPixFmtDescriptor *desc = td->desc;
+ const int slice_start = (in->height * jobnr) / nb_jobs;
+ const int slice_end = (in->height * (jobnr+1)) / nb_jobs;
+ double peak = td->peak;
+
+ for (int y = slice_start; y < slice_end; y++)
+ for (int x = 0; x < out->width; x++)
+ tonemap(s, out, in, desc, x, y, peak);
+
+ return 0;
+}
+
static int filter_frame(AVFilterLink *link, AVFrame *in)
{
- TonemapContext *s = link->dst->priv;
- AVFilterLink *outlink = link->dst->outputs[0];
+ AVFilterContext *ctx = link->dst;
+ TonemapContext *s = ctx->priv;
+ AVFilterLink *outlink = ctx->outputs[0];
+ ThreadData td;
AVFrame *out;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
const AVPixFmtDescriptor *odesc = av_pix_fmt_desc_get(outlink->format);
@@ -245,9 +271,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
}
/* do the tone map */
- for (y = 0; y < out->height; y++)
- for (x = 0; x < out->width; x++)
- tonemap(s, out, in, desc, x, y, peak);
+ td.out = out;
+ td.in = in;
+ td.desc = desc;
+ td.peak = peak;
+ ctx->internal->execute(ctx, tonemap_slice, &td, NULL, FFMIN(in->height, ff_filter_get_nb_threads(ctx)));
/* copy/generate alpha if needed */
if (desc->flags & AV_PIX_FMT_FLAG_ALPHA && odesc->flags & AV_PIX_FMT_FLAG_ALPHA) {
@@ -315,4 +343,5 @@ AVFilter ff_vf_tonemap = {
.priv_class = &tonemap_class,
.inputs = tonemap_inputs,
.outputs = tonemap_outputs,
+ .flags = AVFILTER_FLAG_SLICE_THREADS,
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_transpose_vaapi.c b/chromium/third_party/ffmpeg/libavfilter/vf_transpose_vaapi.c
index 0e2acc9983c..69dbdd70176 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_transpose_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_transpose_vaapi.c
@@ -123,9 +123,6 @@ static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_fra
VAAPIVPPContext *vpp_ctx = avctx->priv;
TransposeVAAPIContext *ctx = avctx->priv;
AVFrame *output_frame = NULL;
- VASurfaceID input_surface, output_surface;
- VARectangle input_region, output_region;
-
VAProcPipelineParameterBuffer params;
int err;
@@ -139,10 +136,6 @@ static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_fra
if (vpp_ctx->va_context == VA_INVALID_ID)
return AVERROR(EINVAL);
- input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for transpose vpp input.\n",
- input_surface);
-
output_frame = ff_get_video_buffer(outlink, vpp_ctx->output_width,
vpp_ctx->output_height);
if (!output_frame) {
@@ -150,46 +143,22 @@ static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_fra
goto fail;
}
- output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
- av_log(avctx, AV_LOG_DEBUG, "Using surface %#x for transpose vpp output.\n",
- output_surface);
- memset(&params, 0, sizeof(params));
- input_region = (VARectangle) {
- .x = 0,
- .y = 0,
- .width = input_frame->width,
- .height = input_frame->height,
- };
-
- output_region = (VARectangle) {
- .x = 0,
- .y = 0,
- .width = output_frame->width,
- .height = output_frame->height,
- };
-
- params.rotation_state = ctx->rotation_state;
- params.mirror_state = ctx->mirror_state;
-
- params.filters = &vpp_ctx->filter_buffers[0];
- params.num_filters = vpp_ctx->nb_filter_buffers;
-
- params.surface = input_surface;
- params.surface_region = &input_region;
- params.surface_color_standard =
- ff_vaapi_vpp_colour_standard(input_frame->colorspace);
-
- params.output_region = &output_region;
- params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
- params.output_color_standard = params.surface_color_standard;
+ err = av_frame_copy_props(output_frame, input_frame);
+ if (err < 0)
+ return err;
- err = ff_vaapi_vpp_render_picture(avctx, &params, output_surface);
+ err = ff_vaapi_vpp_init_params(avctx, &params,
+ input_frame, output_frame);
if (err < 0)
goto fail;
- err = av_frame_copy_props(output_frame, input_frame);
+ params.rotation_state = ctx->rotation_state;
+ params.mirror_state = ctx->mirror_state;
+
+ err = ff_vaapi_vpp_render_picture(avctx, &params, output_frame);
if (err < 0)
goto fail;
+
av_frame_free(&input_frame);
av_log(avctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c b/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
index 41ccc56942b..af05833a5d4 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_unsharp.c
@@ -47,15 +47,22 @@
#include "libavutil/pixdesc.h"
#include "unsharp.h"
-static void apply_unsharp( uint8_t *dst, int dst_stride,
- const uint8_t *src, int src_stride,
- int width, int height, UnsharpFilterParam *fp)
+typedef struct TheadData {
+ UnsharpFilterParam *fp;
+ uint8_t *dst;
+ const uint8_t *src;
+ int dst_stride;
+ int src_stride;
+ int width;
+ int height;
+} ThreadData;
+
+static int unsharp_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
+ ThreadData *td = arg;
+ UnsharpFilterParam *fp = td->fp;
uint32_t **sc = fp->sc;
- uint32_t sr[MAX_MATRIX_SIZE - 1], tmp1, tmp2;
-
- int32_t res;
- int x, y, z;
+ uint32_t *sr = fp->sr;
const uint8_t *src2 = NULL; //silence a warning
const int amount = fp->amount;
const int steps_x = fp->steps_x;
@@ -63,30 +70,54 @@ static void apply_unsharp( uint8_t *dst, int dst_stride,
const int scalebits = fp->scalebits;
const int32_t halfscale = fp->halfscale;
+ uint8_t *dst = td->dst;
+ const uint8_t *src = td->src;
+ const int dst_stride = td->dst_stride;
+ const int src_stride = td->src_stride;
+ const int width = td->width;
+ const int height = td->height;
+ const int sc_offset = jobnr * 2 * steps_y;
+ const int sr_offset = jobnr * (MAX_MATRIX_SIZE - 1);
+ const int slice_start = (height * jobnr) / nb_jobs;
+ const int slice_end = (height * (jobnr+1)) / nb_jobs;
+
+ int32_t res;
+ int x, y, z;
+ uint32_t tmp1, tmp2;
+
if (!amount) {
- av_image_copy_plane(dst, dst_stride, src, src_stride, width, height);
- return;
+ av_image_copy_plane(dst + slice_start * dst_stride, dst_stride,
+ src + slice_start * src_stride, src_stride,
+ width, slice_end - slice_start);
+ return 0;
}
for (y = 0; y < 2 * steps_y; y++)
- memset(sc[y], 0, sizeof(sc[y][0]) * (width + 2 * steps_x));
+ memset(sc[sc_offset + y], 0, sizeof(sc[y][0]) * (width + 2 * steps_x));
- for (y = -steps_y; y < height + steps_y; y++) {
+ // if this is not the first tile, we start from (slice_start - steps_y),
+ // so we can get smooth result at slice boundary
+ if (slice_start > steps_y) {
+ src += (slice_start - steps_y) * src_stride;
+ dst += (slice_start - steps_y) * dst_stride;
+ }
+
+ for (y = -steps_y + slice_start; y < steps_y + slice_end; y++) {
if (y < height)
src2 = src;
- memset(sr, 0, sizeof(sr[0]) * (2 * steps_x - 1));
+ memset(sr + sr_offset, 0, sizeof(sr[0]) * (2 * steps_x - 1));
for (x = -steps_x; x < width + steps_x; x++) {
tmp1 = x <= 0 ? src2[0] : x >= width ? src2[width-1] : src2[x];
for (z = 0; z < steps_x * 2; z += 2) {
- tmp2 = sr[z + 0] + tmp1; sr[z + 0] = tmp1;
- tmp1 = sr[z + 1] + tmp2; sr[z + 1] = tmp2;
+ tmp2 = sr[sr_offset + z + 0] + tmp1; sr[sr_offset + z + 0] = tmp1;
+ tmp1 = sr[sr_offset + z + 1] + tmp2; sr[sr_offset + z + 1] = tmp2;
}
for (z = 0; z < steps_y * 2; z += 2) {
- tmp2 = sc[z + 0][x + steps_x] + tmp1; sc[z + 0][x + steps_x] = tmp1;
- tmp1 = sc[z + 1][x + steps_x] + tmp2; sc[z + 1][x + steps_x] = tmp2;
+ tmp2 = sc[sc_offset + z + 0][x + steps_x] + tmp1; sc[sc_offset + z + 0][x + steps_x] = tmp1;
+ tmp1 = sc[sc_offset + z + 1][x + steps_x] + tmp2; sc[sc_offset + z + 1][x + steps_x] = tmp2;
}
- if (x >= steps_x && y >= steps_y) {
+ if (x >= steps_x && y >= (steps_y + slice_start)) {
const uint8_t *srx = src - steps_y * src_stride + x - steps_x;
uint8_t *dsx = dst - steps_y * dst_stride + x - steps_x;
@@ -99,6 +130,7 @@ static void apply_unsharp( uint8_t *dst, int dst_stride,
src += src_stride;
}
}
+ return 0;
}
static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
@@ -107,6 +139,8 @@ static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
UnsharpContext *s = ctx->priv;
int i, plane_w[3], plane_h[3];
UnsharpFilterParam *fp[3];
+ ThreadData td;
+
plane_w[0] = inlink->w;
plane_w[1] = plane_w[2] = AV_CEIL_RSHIFT(inlink->w, s->hsub);
plane_h[0] = inlink->h;
@@ -114,7 +148,14 @@ static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
fp[0] = &s->luma;
fp[1] = fp[2] = &s->chroma;
for (i = 0; i < 3; i++) {
- apply_unsharp(out->data[i], out->linesize[i], in->data[i], in->linesize[i], plane_w[i], plane_h[i], fp[i]);
+ td.fp = fp[i];
+ td.dst = out->data[i];
+ td.src = in->data[i];
+ td.width = plane_w[i];
+ td.height = plane_h[i];
+ td.dst_stride = out->linesize[i];
+ td.src_stride = in->linesize[i];
+ ctx->internal->execute(ctx, unsharp_slice, &td, NULL, FFMIN(plane_h[i], s->nb_threads));
}
return 0;
}
@@ -163,6 +204,7 @@ static int query_formats(AVFilterContext *ctx)
static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const char *effect_type, int width)
{
int z;
+ UnsharpContext *s = ctx->priv;
const char *effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";
if (!(fp->msize_x & fp->msize_y & 1)) {
@@ -175,7 +217,12 @@ static int init_filter_param(AVFilterContext *ctx, UnsharpFilterParam *fp, const
av_log(ctx, AV_LOG_VERBOSE, "effect:%s type:%s msize_x:%d msize_y:%d amount:%0.2f\n",
effect, effect_type, fp->msize_x, fp->msize_y, fp->amount / 65535.0);
- for (z = 0; z < 2 * fp->steps_y; z++)
+ fp->sr = av_malloc_array((MAX_MATRIX_SIZE - 1) * s->nb_threads, sizeof(uint32_t));
+ fp->sc = av_malloc_array(2 * fp->steps_y * s->nb_threads, sizeof(uint32_t **));
+ if (!fp->sr || !fp->sc)
+ return AVERROR(ENOMEM);
+
+ for (z = 0; z < 2 * fp->steps_y * s->nb_threads; z++)
if (!(fp->sc[z] = av_malloc_array(width + 2 * fp->steps_x,
sizeof(*(fp->sc[z])))))
return AVERROR(ENOMEM);
@@ -192,6 +239,11 @@ static int config_props(AVFilterLink *link)
s->hsub = desc->log2_chroma_w;
s->vsub = desc->log2_chroma_h;
+ // ensure (height / nb_threads) > 4 * steps_y,
+ // so that we don't have too much overlap between two threads
+ s->nb_threads = FFMIN(ff_filter_get_nb_threads(link->dst),
+ link->h / (4 * s->luma.steps_y));
+
ret = init_filter_param(link->dst, &s->luma, "luma", link->w);
if (ret < 0)
return ret;
@@ -202,20 +254,22 @@ static int config_props(AVFilterLink *link)
return 0;
}
-static void free_filter_param(UnsharpFilterParam *fp)
+static void free_filter_param(UnsharpFilterParam *fp, int nb_threads)
{
int z;
- for (z = 0; z < 2 * fp->steps_y; z++)
+ for (z = 0; z < 2 * fp->steps_y * nb_threads; z++)
av_freep(&fp->sc[z]);
+ av_freep(&fp->sc);
+ av_freep(&fp->sr);
}
static av_cold void uninit(AVFilterContext *ctx)
{
UnsharpContext *s = ctx->priv;
- free_filter_param(&s->luma);
- free_filter_param(&s->chroma);
+ free_filter_param(&s->luma, s->nb_threads);
+ free_filter_param(&s->chroma, s->nb_threads);
}
static int filter_frame(AVFilterLink *link, AVFrame *in)
@@ -294,5 +348,5 @@ AVFilter ff_vf_unsharp = {
.query_formats = query_formats,
.inputs = avfilter_vf_unsharp_inputs,
.outputs = avfilter_vf_unsharp_outputs,
- .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_vibrance.c b/chromium/third_party/ffmpeg/libavfilter/vf_vibrance.c
index 1e5bf26512f..aac61c0f108 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vibrance.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vibrance.c
@@ -31,6 +31,7 @@ typedef struct VibranceContext {
float intensity;
float balance[3];
float lcoeffs[3];
+ int alternate;
int depth;
@@ -49,13 +50,18 @@ static int vibrance_slice8(AVFilterContext *avctx, void *arg, int jobnr, int nb_
AVFrame *frame = arg;
const int width = frame->width;
const int height = frame->height;
+ const float scale = 1.f / 255.f;
const float gc = s->lcoeffs[0];
const float bc = s->lcoeffs[1];
const float rc = s->lcoeffs[2];
const float intensity = s->intensity;
+ const float alternate = s->alternate ? 1.f : -1.f;
const float gintensity = intensity * s->balance[0];
const float bintensity = intensity * s->balance[1];
const float rintensity = intensity * s->balance[2];
+ const float sgintensity = alternate * FFSIGN(gintensity);
+ const float sbintensity = alternate * FFSIGN(bintensity);
+ const float srintensity = alternate * FFSIGN(rintensity);
const int slice_start = (height * jobnr) / nb_jobs;
const int slice_end = (height * (jobnr + 1)) / nb_jobs;
const int glinesize = frame->linesize[0];
@@ -67,16 +73,16 @@ static int vibrance_slice8(AVFilterContext *avctx, void *arg, int jobnr, int nb_
for (int y = slice_start; y < slice_end; y++) {
for (int x = 0; x < width; x++) {
- float g = gptr[x] / 255.f;
- float b = bptr[x] / 255.f;
- float r = rptr[x] / 255.f;
+ float g = gptr[x] * scale;
+ float b = bptr[x] * scale;
+ float r = rptr[x] * scale;
float max_color = FFMAX3(r, g, b);
float min_color = FFMIN3(r, g, b);
float color_saturation = max_color - min_color;
float luma = g * gc + r * rc + b * bc;
- const float cg = 1.f + gintensity * (1.f - FFSIGN(gintensity) * color_saturation);
- const float cb = 1.f + bintensity * (1.f - FFSIGN(bintensity) * color_saturation);
- const float cr = 1.f + rintensity * (1.f - FFSIGN(rintensity) * color_saturation);
+ const float cg = 1.f + gintensity * (1.f - sgintensity * color_saturation);
+ const float cb = 1.f + bintensity * (1.f - sbintensity * color_saturation);
+ const float cr = 1.f + rintensity * (1.f - srintensity * color_saturation);
g = lerpf(luma, g, cg);
b = lerpf(luma, b, cb);
@@ -101,15 +107,20 @@ static int vibrance_slice16(AVFilterContext *avctx, void *arg, int jobnr, int nb
AVFrame *frame = arg;
const int depth = s->depth;
const float max = (1 << depth) - 1;
+ const float scale = 1.f / max;
const float gc = s->lcoeffs[0];
const float bc = s->lcoeffs[1];
const float rc = s->lcoeffs[2];
const int width = frame->width;
const int height = frame->height;
const float intensity = s->intensity;
+ const float alternate = s->alternate ? 1.f : -1.f;
const float gintensity = intensity * s->balance[0];
const float bintensity = intensity * s->balance[1];
const float rintensity = intensity * s->balance[2];
+ const float sgintensity = alternate * FFSIGN(gintensity);
+ const float sbintensity = alternate * FFSIGN(bintensity);
+ const float srintensity = alternate * FFSIGN(rintensity);
const int slice_start = (height * jobnr) / nb_jobs;
const int slice_end = (height * (jobnr + 1)) / nb_jobs;
const int glinesize = frame->linesize[0] / 2;
@@ -121,16 +132,16 @@ static int vibrance_slice16(AVFilterContext *avctx, void *arg, int jobnr, int nb
for (int y = slice_start; y < slice_end; y++) {
for (int x = 0; x < width; x++) {
- float g = gptr[x] / max;
- float b = bptr[x] / max;
- float r = rptr[x] / max;
+ float g = gptr[x] * scale;
+ float b = bptr[x] * scale;
+ float r = rptr[x] * scale;
float max_color = FFMAX3(r, g, b);
float min_color = FFMIN3(r, g, b);
float color_saturation = max_color - min_color;
float luma = g * gc + r * rc + b * bc;
- const float cg = 1.f + gintensity * (1.f - FFSIGN(gintensity) * color_saturation);
- const float cb = 1.f + bintensity * (1.f - FFSIGN(bintensity) * color_saturation);
- const float cr = 1.f + rintensity * (1.f - FFSIGN(rintensity) * color_saturation);
+ const float cg = 1.f + gintensity * (1.f - sgintensity * color_saturation);
+ const float cb = 1.f + bintensity * (1.f - sbintensity * color_saturation);
+ const float cr = 1.f + rintensity * (1.f - srintensity * color_saturation);
g = lerpf(luma, g, cg);
b = lerpf(luma, b, cb);
@@ -223,6 +234,7 @@ static const AVOption vibrance_options[] = {
{ "rlum", "set the red luma coefficient", OFFSET(lcoeffs[2]), AV_OPT_TYPE_FLOAT, {.dbl=0.072186}, 0, 1, VF },
{ "glum", "set the green luma coefficient", OFFSET(lcoeffs[0]), AV_OPT_TYPE_FLOAT, {.dbl=0.715158}, 0, 1, VF },
{ "blum", "set the blue luma coefficient", OFFSET(lcoeffs[1]), AV_OPT_TYPE_FLOAT, {.dbl=0.212656}, 0, 1, VF },
+ { "alternate", "use alternate colors", OFFSET(alternate), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, VF },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vmafmotion.c b/chromium/third_party/ffmpeg/libavfilter/vf_vmafmotion.c
index 9bcc4ff16fd..5c2a9745381 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vmafmotion.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vmafmotion.c
@@ -27,7 +27,6 @@
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
-#include "drawutils.h"
#include "formats.h"
#include "internal.h"
#include "vmaf_motion.h"
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_vpp_qsv.c b/chromium/third_party/ffmpeg/libavfilter/vf_vpp_qsv.c
index 41a9f389627..915cf748c40 100644
--- a/chromium/third_party/ffmpeg/libavfilter/vf_vpp_qsv.c
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_vpp_qsv.c
@@ -57,6 +57,10 @@ typedef struct VPPContext{
int out_width;
int out_height;
+ /**
+ * Output sw format. AV_PIX_FMT_NONE for no conversion.
+ */
+ enum AVPixelFormat out_format;
AVRational framerate; /* target framerate */
int use_frc; /* use framerate conversion */
@@ -79,6 +83,7 @@ typedef struct VPPContext{
char *cx, *cy, *cw, *ch;
char *ow, *oh;
+ char *output_format_str;
} VPPContext;
static const AVOption options[] = {
@@ -104,6 +109,8 @@ static const AVOption options[] = {
{ "width", "Output video width", OFFSET(ow), AV_OPT_TYPE_STRING, { .str="cw" }, 0, 255, .flags = FLAGS },
{ "h", "Output video height", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS },
{ "height", "Output video height", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS },
+ { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
+
{ NULL }
};
@@ -207,6 +214,23 @@ release:
return ret;
}
+static av_cold int vpp_init(AVFilterContext *ctx)
+{
+ VPPContext *vpp = ctx->priv;
+
+ if (!strcmp(vpp->output_format_str, "same")) {
+ vpp->out_format = AV_PIX_FMT_NONE;
+ } else {
+ vpp->out_format = av_get_pix_fmt(vpp->output_format_str);
+ if (vpp->out_format == AV_PIX_FMT_NONE) {
+ av_log(ctx, AV_LOG_ERROR, "Unrecognized output pixel format: %s\n", vpp->output_format_str);
+ return AVERROR(EINVAL);
+ }
+ }
+
+ return 0;
+}
+
static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
@@ -251,6 +275,7 @@ static int config_output(AVFilterLink *outlink)
QSVVPPCrop crop = { 0 };
mfxExtBuffer *ext_buf[ENH_FILTERS_COUNT];
AVFilterLink *inlink = ctx->inputs[0];
+ enum AVPixelFormat in_format;
outlink->w = vpp->out_width;
outlink->h = vpp->out_height;
@@ -258,10 +283,19 @@ static int config_output(AVFilterLink *outlink)
outlink->time_base = av_inv_q(vpp->framerate);
param.filter_frame = NULL;
- param.out_sw_format = AV_PIX_FMT_NV12;
param.num_ext_buf = 0;
param.ext_buf = ext_buf;
+ if (inlink->format == AV_PIX_FMT_QSV) {
+ if (!inlink->hw_frames_ctx || !inlink->hw_frames_ctx->data)
+ return AVERROR(EINVAL);
+ else
+ in_format = ((AVHWFramesContext*)inlink->hw_frames_ctx->data)->sw_format;
+ } else
+ in_format = inlink->format;
+
+ param.out_sw_format = (vpp->out_format == AV_PIX_FMT_NONE) ? in_format : vpp->out_format;
+
if (vpp->use_crop) {
crop.in_idx = 0;
crop.x = vpp->crop_x;
@@ -367,6 +401,7 @@ static int query_formats(AVFilterContext *ctx)
};
static const enum AVPixelFormat out_pix_fmts[] = {
AV_PIX_FMT_NV12,
+ AV_PIX_FMT_P010,
AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE
};
@@ -421,6 +456,7 @@ AVFilter ff_vf_vpp_qsv = {
.description = NULL_IF_CONFIG_SMALL("Quick Sync Video VPP."),
.priv_size = sizeof(VPPContext),
.query_formats = query_formats,
+ .init = vpp_init,
.uninit = vpp_uninit,
.inputs = vpp_inputs,
.outputs = vpp_outputs,
diff --git a/chromium/third_party/ffmpeg/libavfilter/vf_xmedian.c b/chromium/third_party/ffmpeg/libavfilter/vf_xmedian.c
new file mode 100644
index 00000000000..672b3a7e78a
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/vf_xmedian.c
@@ -0,0 +1,351 @@
+/*
+ * Copyright (c) 2019 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/avstring.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/qsort.h"
+
+#include "avfilter.h"
+#include "formats.h"
+#include "internal.h"
+#include "framesync.h"
+#include "video.h"
+
+typedef struct XMedianContext {
+ const AVClass *class;
+ const AVPixFmtDescriptor *desc;
+ int nb_inputs;
+ int planes;
+
+ int radius;
+ int depth;
+ int max;
+ int nb_planes;
+ int linesize[4];
+ int width[4];
+ int height[4];
+
+ AVFrame **frames;
+ FFFrameSync fs;
+
+ int (*median_frames)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
+} XMedianContext;
+
+static int query_formats(AVFilterContext *ctx)
+{
+ static const enum AVPixelFormat pixel_fmts[] = {
+ AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_GRAY9,
+ AV_PIX_FMT_GRAY10,
+ AV_PIX_FMT_GRAY12,
+ AV_PIX_FMT_GRAY14,
+ AV_PIX_FMT_GRAY16,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P,
+ AV_PIX_FMT_YUVJ411P,
+ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
+ AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
+ AV_PIX_FMT_YUV440P10,
+ AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV420P12,
+ AV_PIX_FMT_YUV440P12,
+ AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV420P14,
+ AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10,
+ AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16,
+ AV_PIX_FMT_NONE
+ };
+ AVFilterFormats *formats = ff_make_format_list(pixel_fmts);
+ if (!formats)
+ return AVERROR(ENOMEM);
+ return ff_set_common_formats(ctx, formats);
+}
+
+static av_cold int init(AVFilterContext *ctx)
+{
+ XMedianContext *s = ctx->priv;
+ int ret;
+
+ s->radius = s->nb_inputs / 2;
+ s->frames = av_calloc(s->nb_inputs, sizeof(*s->frames));
+ if (!s->frames)
+ return AVERROR(ENOMEM);
+
+ for (int i = 0; i < s->nb_inputs; i++) {
+ AVFilterPad pad = { 0 };
+
+ pad.type = AVMEDIA_TYPE_VIDEO;
+ pad.name = av_asprintf("input%d", i);
+ if (!pad.name)
+ return AVERROR(ENOMEM);
+
+ if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
+ av_freep(&pad.name);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+typedef struct ThreadData {
+ AVFrame **in, *out;
+} ThreadData;
+
+static int comparei(const void *p1, const void *p2)
+{
+ int left = *(const int *)p1;
+ int right = *(const int *)p2;
+ return FFDIFFSIGN(left, right);
+}
+
+static int median_frames16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ XMedianContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame **in = td->in;
+ AVFrame *out = td->out;
+ const int nb_inputs = s->nb_inputs;
+ const int radius = s->radius;
+ int values[256];
+
+ for (int p = 0; p < s->nb_planes; p++) {
+ const int slice_start = (s->height[p] * jobnr) / nb_jobs;
+ const int slice_end = (s->height[p] * (jobnr+1)) / nb_jobs;
+ uint16_t *dst = (uint16_t *)(out->data[p] + slice_start * out->linesize[p]);
+
+ if (!((1 << p) & s->planes)) {
+ av_image_copy_plane((uint8_t *)dst, out->linesize[p],
+ in[0]->data[p] + slice_start * in[radius]->linesize[p],
+ in[0]->linesize[p],
+ s->linesize[p], slice_end - slice_start);
+ continue;
+ }
+
+ for (int y = slice_start; y < slice_end; y++) {
+ for (int x = 0; x < s->width[p]; x++) {
+ for (int i = 0; i < nb_inputs; i++) {
+ const uint16_t *src = (const uint16_t *)(in[i]->data[p] + y * in[i]->linesize[p]);
+ values[i] = src[x];
+ }
+
+ AV_QSORT(values, nb_inputs, int, comparei);
+ if (radius & 1)
+ dst[x] = values[radius];
+ else
+ dst[x] = (values[radius] + values[radius - 1]) >> 1;
+ }
+
+ dst += out->linesize[p] / 2;
+ }
+ }
+
+ return 0;
+}
+
+static int median_frames8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
+{
+ XMedianContext *s = ctx->priv;
+ ThreadData *td = arg;
+ AVFrame **in = td->in;
+ AVFrame *out = td->out;
+ const int nb_inputs = s->nb_inputs;
+ const int radius = s->radius;
+ int values[256];
+
+ for (int p = 0; p < s->nb_planes; p++) {
+ const int slice_start = (s->height[p] * jobnr) / nb_jobs;
+ const int slice_end = (s->height[p] * (jobnr+1)) / nb_jobs;
+ uint8_t *dst = out->data[p] + slice_start * out->linesize[p];
+
+ if (!((1 << p) & s->planes)) {
+ av_image_copy_plane(dst, out->linesize[p],
+ in[0]->data[p] + slice_start * in[0]->linesize[p],
+ in[0]->linesize[p],
+ s->linesize[p], slice_end - slice_start);
+ continue;
+ }
+
+ for (int y = slice_start; y < slice_end; y++) {
+ for (int x = 0; x < s->width[p]; x++) {
+ for (int i = 0; i < nb_inputs; i++)
+ values[i] = in[i]->data[p][y * in[i]->linesize[p] + x];
+
+ AV_QSORT(values, nb_inputs, int, comparei);
+ if (radius & 1)
+ dst[x] = values[radius];
+ else
+ dst[x] = (values[radius] + values[radius - 1]) >> 1;
+ }
+
+ dst += out->linesize[p];
+ }
+ }
+
+ return 0;
+}
+
+static int process_frame(FFFrameSync *fs)
+{
+ AVFilterContext *ctx = fs->parent;
+ AVFilterLink *outlink = ctx->outputs[0];
+ XMedianContext *s = fs->opaque;
+ AVFrame **in = s->frames;
+ AVFrame *out;
+ ThreadData td;
+ int i, ret;
+
+ for (i = 0; i < s->nb_inputs; i++) {
+ if ((ret = ff_framesync_get_frame(&s->fs, i, &in[i], 0)) < 0)
+ return ret;
+ }
+
+ out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+ if (!out)
+ return AVERROR(ENOMEM);
+ out->pts = av_rescale_q(s->fs.pts, s->fs.time_base, outlink->time_base);
+
+ td.in = in;
+ td.out = out;
+ ctx->internal->execute(ctx, s->median_frames, &td, NULL, FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
+
+ return ff_filter_frame(outlink, out);
+}
+
+static int config_output(AVFilterLink *outlink)
+{
+ AVFilterContext *ctx = outlink->src;
+ XMedianContext *s = ctx->priv;
+ AVRational frame_rate = ctx->inputs[0]->frame_rate;
+ AVRational sar = ctx->inputs[0]->sample_aspect_ratio;
+ AVFilterLink *inlink = ctx->inputs[0];
+ int height = ctx->inputs[0]->h;
+ int width = ctx->inputs[0]->w;
+ FFFrameSyncIn *in;
+ int i, ret;
+
+ for (int i = 1; i < s->nb_inputs; i++) {
+ if (ctx->inputs[i]->h != height || ctx->inputs[i]->w != width) {
+ av_log(ctx, AV_LOG_ERROR, "Input %d size (%dx%d) does not match input %d size (%dx%d).\n", i, ctx->inputs[i]->w, ctx->inputs[i]->h, 0, width, height);
+ return AVERROR(EINVAL);
+ }
+ }
+
+ s->desc = av_pix_fmt_desc_get(outlink->format);
+ if (!s->desc)
+ return AVERROR_BUG;
+ s->nb_planes = av_pix_fmt_count_planes(outlink->format);
+ s->depth = s->desc->comp[0].depth;
+ s->max = (1 << s->depth) - 1;
+
+ if (s->depth <= 8)
+ s->median_frames = median_frames8;
+ else
+ s->median_frames = median_frames16;
+
+ if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
+ return ret;
+
+ s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, s->desc->log2_chroma_w);
+ s->width[0] = s->width[3] = inlink->w;
+ s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
+ s->height[0] = s->height[3] = inlink->h;
+
+ outlink->w = width;
+ outlink->h = height;
+ outlink->frame_rate = frame_rate;
+ outlink->sample_aspect_ratio = sar;
+
+ if ((ret = ff_framesync_init(&s->fs, ctx, s->nb_inputs)) < 0)
+ return ret;
+
+ in = s->fs.in;
+ s->fs.opaque = s;
+ s->fs.on_event = process_frame;
+
+ for (i = 0; i < s->nb_inputs; i++) {
+ AVFilterLink *inlink = ctx->inputs[i];
+
+ in[i].time_base = inlink->time_base;
+ in[i].sync = 1;
+ in[i].before = EXT_STOP;
+ in[i].after = EXT_STOP;
+ }
+
+ ret = ff_framesync_configure(&s->fs);
+ outlink->time_base = s->fs.time_base;
+
+ return ret;
+}
+
+static av_cold void uninit(AVFilterContext *ctx)
+{
+ XMedianContext *s = ctx->priv;
+
+ ff_framesync_uninit(&s->fs);
+ av_freep(&s->frames);
+
+ for (int i = 0; i < ctx->nb_inputs; i++)
+ av_freep(&ctx->input_pads[i].name);
+}
+
+static int activate(AVFilterContext *ctx)
+{
+ XMedianContext *s = ctx->priv;
+ return ff_framesync_activate(&s->fs);
+}
+
+#define OFFSET(x) offsetof(XMedianContext, x)
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
+
+static const AVOption xmedian_options[] = {
+ { "inputs", "set number of inputs", OFFSET(nb_inputs), AV_OPT_TYPE_INT, {.i64=3}, 3, 255, .flags = FLAGS },
+ { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, .flags = FLAGS },
+ { NULL },
+};
+
+static const AVFilterPad outputs[] = {
+ {
+ .name = "default",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .config_props = config_output,
+ },
+ { NULL }
+};
+
+AVFILTER_DEFINE_CLASS(xmedian);
+
+AVFilter ff_vf_xmedian = {
+ .name = "xmedian",
+ .description = NULL_IF_CONFIG_SMALL("Pick median pixels from several video inputs."),
+ .priv_size = sizeof(XMedianContext),
+ .priv_class = &xmedian_class,
+ .query_formats = query_formats,
+ .outputs = outputs,
+ .init = init,
+ .uninit = uninit,
+ .activate = activate,
+ .flags = AVFILTER_FLAG_DYNAMIC_INPUTS | AVFILTER_FLAG_SLICE_THREADS,
+};
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
index 17499f14da5..6b0361bed29 100644
--- a/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/Makefile
@@ -7,6 +7,7 @@ OBJS-$(CONFIG_BWDIF_FILTER) += x86/vf_bwdif_init.o
OBJS-$(CONFIG_COLORSPACE_FILTER) += x86/colorspacedsp_init.o
OBJS-$(CONFIG_EQ_FILTER) += x86/vf_eq.o
OBJS-$(CONFIG_FSPP_FILTER) += x86/vf_fspp_init.o
+OBJS-$(CONFIG_GBLUR_FILTER) += x86/vf_gblur_init.o
OBJS-$(CONFIG_GRADFUN_FILTER) += x86/vf_gradfun_init.o
OBJS-$(CONFIG_FRAMERATE_FILTER) += x86/vf_framerate_init.o
OBJS-$(CONFIG_HFLIP_FILTER) += x86/vf_hflip_init.o
@@ -41,6 +42,7 @@ X86ASM-OBJS-$(CONFIG_BWDIF_FILTER) += x86/vf_bwdif.o
X86ASM-OBJS-$(CONFIG_COLORSPACE_FILTER) += x86/colorspacedsp.o
X86ASM-OBJS-$(CONFIG_FRAMERATE_FILTER) += x86/vf_framerate.o
X86ASM-OBJS-$(CONFIG_FSPP_FILTER) += x86/vf_fspp.o
+X86ASM-OBJS-$(CONFIG_GBLUR_FILTER) += x86/vf_gblur.o
X86ASM-OBJS-$(CONFIG_GRADFUN_FILTER) += x86/vf_gradfun.o
X86ASM-OBJS-$(CONFIG_HFLIP_FILTER) += x86/vf_hflip.o
X86ASM-OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d.o
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur.asm b/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur.asm
new file mode 100644
index 00000000000..762c953c852
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur.asm
@@ -0,0 +1,185 @@
+;*****************************************************************************
+;* x86-optimized functions for gblur filter
+;*
+;* 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
+
+; void ff_horiz_slice_sse4(float *ptr, int width, int height, int steps,
+; float nu, float bscale)
+
+%macro HORIZ_SLICE 0
+%if UNIX64
+cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, x, y, step, stride, remain
+%else
+cglobal horiz_slice, 4, 9, 9, ptr, width, height, steps, nu, bscale, x, y, step, stride, remain
+%endif
+%if WIN64
+ movss m0, num
+ movss m1, bscalem
+ DEFINE_ARGS ptr, width, height, steps, x, y, step, stride, remain
+%endif
+ movsxdifnidn widthq, widthd
+
+ mulss m2, m0, m0 ; nu ^ 2
+ mulss m3, m2, m0 ; nu ^ 3
+ mulss m4, m3, m0 ; nu ^ 4
+ xor xq, xq
+ xor yd, yd
+ mov strideq, widthq
+ ; stride = width * 4
+ shl strideq, 2
+ ; w = w - ((w - 1) & 3)
+ mov remainq, widthq
+ sub remainq, 1
+ and remainq, 3
+ sub widthq, remainq
+
+ shufps m0, m0, 0
+ shufps m2, m2, 0
+ shufps m3, m3, 0
+ shufps m4, m4, 0
+
+.loop_y:
+ xor stepd, stepd
+
+ .loop_step:
+ ; p0 *= bscale
+ mulss m5, m1, [ptrq + xq * 4]
+ movss [ptrq + xq * 4], m5
+ inc xq
+ ; filter rightwards
+ ; Here we are vectorizing the c version by 4
+ ; for (x = 1; x < width; x++)
+ ; ptr[x] += nu * ptr[x - 1];
+ ; let p0 stands for ptr[x-1], the data from last loop
+ ; and [p1,p2,p3,p4] be the vector data for this loop.
+ ; Unrolling the loop, we get:
+ ; p1' = p1 + p0*nu
+ ; p2' = p2 + p1*nu + p0*nu^2
+ ; p3' = p3 + p2*nu + p1*nu^2 + p0*nu^3
+ ; p4' = p4 + p3*nu + p2*nu^2 + p1*nu^3 + p0*nu^4
+ ; so we can do it in simd:
+ ; [p1',p2',p3',p4'] = [p1,p2,p3,p4] + [p0,p1,p2,p3]*nu +
+ ; [0,p0,p1,p2]*nu^2 + [0,0,p0,p1]*nu^3 +
+ ; [0,0,0,p0]*nu^4
+
+ .loop_x:
+ movu m6, [ptrq + xq * 4] ; s = [p1,p2,p3,p4]
+ pslldq m7, m6, 4 ; [0, p1,p2,p3]
+ movss m7, m5 ; [p0,p1,p2,p3]
+ FMULADD_PS m6, m7, m0, m6, m8 ; s += [p0,p1,p2,p3] * nu
+ pslldq m7, 4 ; [0,p0,p1,p2]
+ FMULADD_PS m6, m7, m2, m6, m8 ; s += [0,p0,p1,p2] * nu^2
+ pslldq m7, 4
+ FMULADD_PS m6, m7, m3, m6, m8 ; s += [0,0,p0,p1] * nu^3
+ pslldq m7, 4
+ FMULADD_PS m6, m7, m4, m6, m8 ; s += [0,0,0,p0] * nu^4
+ movu [ptrq + xq * 4], m6
+ shufps m5, m6, m6, q3333
+ add xq, 4
+ cmp xq, widthq
+ jl .loop_x
+
+ add widthq, remainq
+ cmp xq, widthq
+ je .end_scalar
+
+ .loop_scalar:
+ ; ptr[x] += nu * ptr[x-1]
+ movss m5, [ptrq + 4*xq - 4]
+ mulss m5, m0
+ addss m5, [ptrq + 4*xq]
+ movss [ptrq + 4*xq], m5
+ inc xq
+ cmp xq, widthq
+ jl .loop_scalar
+ .end_scalar:
+ ; ptr[width - 1] *= bscale
+ dec xq
+ mulss m5, m1, [ptrq + 4*xq]
+ movss [ptrq + 4*xq], m5
+ shufps m5, m5, 0
+
+ ; filter leftwards
+ ; for (; x > 0; x--)
+ ; ptr[x - 1] += nu * ptr[x];
+ ; The idea here is basically the same as filter rightwards.
+ ; But we need to take care as the data layout is different.
+ ; Let p0 stands for the ptr[x], which is the data from last loop.
+ ; The way we do it in simd as below:
+ ; [p-4', p-3', p-2', p-1'] = [p-4, p-3, p-2, p-1]
+ ; + [p-3, p-2, p-1, p0] * nu
+ ; + [p-2, p-1, p0, 0] * nu^2
+ ; + [p-1, p0, 0, 0] * nu^3
+ ; + [p0, 0, 0, 0] * nu^4
+ .loop_x_back:
+ sub xq, 4
+ movu m6, [ptrq + xq * 4] ; s = [p-4, p-3, p-2, p-1]
+ psrldq m7, m6, 4 ; [p-3, p-2, p-1, 0 ]
+ blendps m7, m5, 0x8 ; [p-3, p-2, p-1, p0 ]
+ FMULADD_PS m6, m7, m0, m6, m8 ; s+= [p-3, p-2, p-1, p0 ] * nu
+ psrldq m7, 4 ;
+ FMULADD_PS m6, m7, m2, m6, m8 ; s+= [p-2, p-1, p0, 0] * nu^2
+ psrldq m7, 4
+ FMULADD_PS m6, m7, m3, m6, m8 ; s+= [p-1, p0, 0, 0] * nu^3
+ psrldq m7, 4
+ FMULADD_PS m6, m7, m4, m6, m8 ; s+= [p0, 0, 0, 0] * nu^4
+ movu [ptrq + xq * 4], m6
+ shufps m5, m6, m6, 0 ; m5 = [p-4', p-4', p-4', p-4']
+ cmp xq, remainq
+ jg .loop_x_back
+
+ cmp xq, 0
+ je .end_scalar_back
+
+ .loop_scalar_back:
+ ; ptr[x-1] += nu * ptr[x]
+ movss m5, [ptrq + 4*xq]
+ mulss m5, m0
+ addss m5, [ptrq + 4*xq - 4]
+ movss [ptrq + 4*xq - 4], m5
+ dec xq
+ cmp xq, 0
+ jg .loop_scalar_back
+ .end_scalar_back:
+
+ ; reset aligned width for next line
+ sub widthq, remainq
+
+ inc stepd
+ cmp stepd, stepsd
+ jl .loop_step
+
+ add ptrq, strideq
+ inc yd
+ cmp yd, heightd
+ jl .loop_y
+
+ RET
+%endmacro
+
+%if ARCH_X86_64
+INIT_XMM sse4
+HORIZ_SLICE
+
+INIT_XMM avx2
+HORIZ_SLICE
+%endif
diff --git a/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur_init.c b/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur_init.c
new file mode 100644
index 00000000000..e63e59fe23f
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavfilter/x86/vf_gblur_init.c
@@ -0,0 +1,40 @@
+/*
+ *
+ * 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/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
+#include "libavfilter/gblur.h"
+
+void ff_horiz_slice_sse4(float *ptr, int width, int height, int steps, float nu, float bscale);
+void ff_horiz_slice_avx2(float *ptr, int width, int height, int steps, float nu, float bscale);
+
+av_cold void ff_gblur_init_x86(GBlurContext *s)
+{
+#if ARCH_X86_64
+ int cpu_flags = av_get_cpu_flags();
+
+ if (EXTERNAL_SSE4(cpu_flags))
+ s->horiz_slice = ff_horiz_slice_sse4;
+ if (EXTERNAL_AVX2(cpu_flags))
+ s->horiz_slice = ff_horiz_slice_avx2;
+#endif
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/Makefile b/chromium/third_party/ffmpeg/libavformat/Makefile
index 99be60d184b..a434b005a46 100644
--- a/chromium/third_party/ffmpeg/libavformat/Makefile
+++ b/chromium/third_party/ffmpeg/libavformat/Makefile
@@ -231,6 +231,7 @@ OBJS-$(CONFIG_ICO_MUXER) += icoenc.o
OBJS-$(CONFIG_IDCIN_DEMUXER) += idcin.o
OBJS-$(CONFIG_IDF_DEMUXER) += bintext.o sauce.o
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
+OBJS-$(CONFIG_IFV_DEMUXER) += ifv.o
OBJS-$(CONFIG_ILBC_DEMUXER) += ilbc.o
OBJS-$(CONFIG_ILBC_MUXER) += ilbc.o
OBJS-$(CONFIG_IMAGE2_DEMUXER) += img2dec.o img2.o
@@ -339,7 +340,7 @@ OBJS-$(CONFIG_MUSX_DEMUXER) += musx.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_MXF_MUXER) += mxfenc.o mxf.o audiointerleave.o avc.o
OBJS-$(CONFIG_MXG_DEMUXER) += mxg.o
OBJS-$(CONFIG_NC_DEMUXER) += ncdec.o
OBJS-$(CONFIG_NISTSPHERE_DEMUXER) += nistspheredec.o pcm.o
diff --git a/chromium/third_party/ffmpeg/libavformat/aacdec.c b/chromium/third_party/ffmpeg/libavformat/aacdec.c
index bd324a1420b..8a5450880b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/aacdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/aacdec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -154,17 +155,8 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, fsize;
- // Parse all the ID3 headers between frames
- while (1) {
- ret = av_get_packet(s->pb, pkt, FFMAX(ID3v2_HEADER_SIZE, ADTS_HEADER_SIZE));
- if (ret >= ID3v2_HEADER_SIZE && ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) {
- if ((ret = handle_id3(s, pkt)) >= 0) {
- continue;
- }
- }
- break;
- }
-
+retry:
+ ret = av_get_packet(s->pb, pkt, ADTS_HEADER_SIZE);
if (ret < 0)
return ret;
@@ -174,8 +166,24 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if ((AV_RB16(pkt->data) >> 4) != 0xfff) {
- av_packet_unref(pkt);
- return AVERROR_INVALIDDATA;
+ // Parse all the ID3 headers between frames
+ int append = ID3v2_HEADER_SIZE - ADTS_HEADER_SIZE;
+
+ av_assert2(append > 0);
+ ret = av_append_packet(s->pb, pkt, append);
+ if (ret != append) {
+ av_packet_unref(pkt);
+ return AVERROR(EIO);
+ }
+ if (!ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) {
+ av_packet_unref(pkt);
+ return AVERROR_INVALIDDATA;
+ }
+ ret = handle_id3(s, pkt);
+ if (ret < 0)
+ return ret;
+
+ goto retry;
}
fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF;
diff --git a/chromium/third_party/ffmpeg/libavformat/aadec.c b/chromium/third_party/ffmpeg/libavformat/aadec.c
index dc94061dcf1..b9dd51ebfc3 100644
--- a/chromium/third_party/ffmpeg/libavformat/aadec.c
+++ b/chromium/third_party/ffmpeg/libavformat/aadec.c
@@ -85,6 +85,7 @@ static int aa_read_header(AVFormatContext *s)
AADemuxContext *c = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
+ int ret;
/* parse .aa header */
avio_skip(pb, 4); // file size
@@ -118,8 +119,12 @@ static int aa_read_header(AVFormatContext *s)
header_seed = atoi(val);
} else if (!strcmp(key, "HeaderKey")) { // this looks like "1234567890 1234567890 1234567890 1234567890"
av_log(s, AV_LOG_DEBUG, "HeaderKey is <%s>\n", val);
- sscanf(val, "%"SCNu32"%"SCNu32"%"SCNu32"%"SCNu32,
+
+ ret = sscanf(val, "%"SCNu32"%"SCNu32"%"SCNu32"%"SCNu32,
&header_key_part[0], &header_key_part[1], &header_key_part[2], &header_key_part[3]);
+ if (ret != 4)
+ return AVERROR_INVALIDDATA;
+
for (idx = 0; idx < 4; idx++) {
AV_WB32(&header_key[idx * 4], header_key_part[idx]); // convert each part to BE!
}
diff --git a/chromium/third_party/ffmpeg/libavformat/allformats.c b/chromium/third_party/ffmpeg/libavformat/allformats.c
index d316a0529a7..cd008348070 100644
--- a/chromium/third_party/ffmpeg/libavformat/allformats.c
+++ b/chromium/third_party/ffmpeg/libavformat/allformats.c
@@ -188,6 +188,7 @@ extern AVOutputFormat ff_ico_muxer;
extern AVInputFormat ff_idcin_demuxer;
extern AVInputFormat ff_idf_demuxer;
extern AVInputFormat ff_iff_demuxer;
+extern AVInputFormat ff_ifv_demuxer;
extern AVInputFormat ff_ilbc_demuxer;
extern AVOutputFormat ff_ilbc_muxer;
extern AVInputFormat ff_image2_demuxer;
diff --git a/chromium/third_party/ffmpeg/libavformat/avc.c b/chromium/third_party/ffmpeg/libavformat/avc.c
index ec50033a042..a041e843574 100644
--- a/chromium/third_party/ffmpeg/libavformat/avc.c
+++ b/chromium/third_party/ffmpeg/libavformat/avc.c
@@ -21,6 +21,7 @@
#include "libavutil/intreadwrite.h"
#include "libavcodec/h264.h"
+#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "avio.h"
#include "avc.h"
@@ -241,3 +242,188 @@ const uint8_t *ff_avc_mp4_find_startcode(const uint8_t *start,
return start + res;
}
+
+uint8_t *ff_nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
+ uint32_t *dst_len, int header_len)
+{
+ uint8_t *dst;
+ uint32_t i, len;
+
+ dst = av_malloc(src_len + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (!dst)
+ return NULL;
+
+ /* NAL unit header */
+ i = len = 0;
+ while (i < header_len && 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++];
+
+ memset(dst + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
+
+ *dst_len = len;
+ return dst;
+}
+
+static const AVRational avc_sample_aspect_ratio[17] = {
+ { 0, 1 },
+ { 1, 1 },
+ { 12, 11 },
+ { 10, 11 },
+ { 16, 11 },
+ { 40, 33 },
+ { 24, 11 },
+ { 20, 11 },
+ { 32, 11 },
+ { 80, 33 },
+ { 18, 11 },
+ { 15, 11 },
+ { 64, 33 },
+ { 160, 99 },
+ { 4, 3 },
+ { 3, 2 },
+ { 2, 1 },
+};
+
+static inline int get_ue_golomb(GetBitContext *gb) {
+ int i;
+ for (i = 0; i < 32 && !get_bits1(gb); i++)
+ ;
+ return get_bitsz(gb, i) + (1 << i) - 1;
+}
+
+static inline int get_se_golomb(GetBitContext *gb) {
+ int v = get_ue_golomb(gb) + 1;
+ int sign = -(v & 1);
+ return ((v >> 1) ^ sign) - sign;
+}
+
+H264SequenceParameterSet *ff_avc_decode_sps(const uint8_t *buf, int buf_size)
+{
+ int i, j, ret, rbsp_size, aspect_ratio_idc, pic_order_cnt_type;
+ int num_ref_frames_in_pic_order_cnt_cycle;
+ int delta_scale, lastScale = 8, nextScale = 8;
+ int sizeOfScalingList;
+ H264SequenceParameterSet *sps = NULL;
+ GetBitContext gb;
+ uint8_t *rbsp_buf;
+
+ rbsp_buf = ff_nal_unit_extract_rbsp(buf, buf_size, &rbsp_size, 0);
+ if (!rbsp_buf)
+ return NULL;
+
+ ret = init_get_bits8(&gb, rbsp_buf, rbsp_size);
+ if (ret < 0)
+ goto end;
+
+ sps = av_mallocz(sizeof(*sps));
+ if (!sps)
+ goto end;
+
+ sps->profile_idc = get_bits(&gb, 8);
+ sps->constraint_set_flags |= get_bits1(&gb) << 0; // constraint_set0_flag
+ sps->constraint_set_flags |= get_bits1(&gb) << 1; // constraint_set1_flag
+ sps->constraint_set_flags |= get_bits1(&gb) << 2; // constraint_set2_flag
+ sps->constraint_set_flags |= get_bits1(&gb) << 3; // constraint_set3_flag
+ sps->constraint_set_flags |= get_bits1(&gb) << 4; // constraint_set4_flag
+ sps->constraint_set_flags |= get_bits1(&gb) << 5; // constraint_set5_flag
+ skip_bits(&gb, 2); // reserved_zero_2bits
+ sps->level_idc = get_bits(&gb, 8);
+ sps->id = get_ue_golomb(&gb);
+
+ 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 == 138 || sps->profile_idc == 139 ||
+ sps->profile_idc == 134) {
+ sps->chroma_format_idc = get_ue_golomb(&gb); // chroma_format_idc
+ if (sps->chroma_format_idc == 3) {
+ skip_bits1(&gb); // separate_colour_plane_flag
+ }
+ sps->bit_depth_luma = get_ue_golomb(&gb) + 8;
+ get_ue_golomb(&gb); // bit_depth_chroma_minus8
+ skip_bits1(&gb); // qpprime_y_zero_transform_bypass_flag
+ if (get_bits1(&gb)) { // seq_scaling_matrix_present_flag
+ for (i = 0; i < ((sps->chroma_format_idc != 3) ? 8 : 12); i++) {
+ if (!get_bits1(&gb)) // seq_scaling_list_present_flag
+ continue;
+ lastScale = 8;
+ nextScale = 8;
+ sizeOfScalingList = i < 6 ? 16 : 64;
+ for (j = 0; j < sizeOfScalingList; j++) {
+ if (nextScale != 0) {
+ delta_scale = get_se_golomb(&gb);
+ nextScale = (lastScale + delta_scale) & 0xff;
+ }
+ lastScale = nextScale == 0 ? lastScale : nextScale;
+ }
+ }
+ }
+ } else {
+ sps->chroma_format_idc = 1;
+ sps->bit_depth_luma = 8;
+ }
+
+ get_ue_golomb(&gb); // log2_max_frame_num_minus4
+ pic_order_cnt_type = get_ue_golomb(&gb);
+
+ if (pic_order_cnt_type == 0) {
+ get_ue_golomb(&gb); // log2_max_pic_order_cnt_lsb_minus4
+ } else if (pic_order_cnt_type == 1) {
+ skip_bits1(&gb); // delta_pic_order_always_zero
+ get_se_golomb(&gb); // offset_for_non_ref_pic
+ get_se_golomb(&gb); // offset_for_top_to_bottom_field
+ num_ref_frames_in_pic_order_cnt_cycle = get_ue_golomb(&gb);
+ for (i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++)
+ get_se_golomb(&gb); // offset_for_ref_frame
+ }
+
+ get_ue_golomb(&gb); // max_num_ref_frames
+ skip_bits1(&gb); // gaps_in_frame_num_value_allowed_flag
+ get_ue_golomb(&gb); // pic_width_in_mbs_minus1
+ get_ue_golomb(&gb); // pic_height_in_map_units_minus1
+
+ sps->frame_mbs_only_flag = get_bits1(&gb);
+ if (!sps->frame_mbs_only_flag)
+ skip_bits1(&gb); // mb_adaptive_frame_field_flag
+
+ skip_bits1(&gb); // direct_8x8_inference_flag
+
+ if (get_bits1(&gb)) { // frame_cropping_flag
+ get_ue_golomb(&gb); // frame_crop_left_offset
+ get_ue_golomb(&gb); // frame_crop_right_offset
+ get_ue_golomb(&gb); // frame_crop_top_offset
+ get_ue_golomb(&gb); // frame_crop_bottom_offset
+ }
+
+ if (get_bits1(&gb)) { // vui_parameters_present_flag
+ if (get_bits1(&gb)) { // aspect_ratio_info_present_flag
+ aspect_ratio_idc = get_bits(&gb, 8);
+ if (aspect_ratio_idc == 0xff) {
+ sps->sar.num = get_bits(&gb, 16);
+ sps->sar.den = get_bits(&gb, 16);
+ } else if (aspect_ratio_idc < FF_ARRAY_ELEMS(avc_sample_aspect_ratio)) {
+ sps->sar = avc_sample_aspect_ratio[aspect_ratio_idc];
+ }
+ }
+ }
+
+ if (!sps->sar.den) {
+ sps->sar.num = 1;
+ sps->sar.den = 1;
+ }
+
+ end:
+ av_free(rbsp_buf);
+ return sps;
+}
diff --git a/chromium/third_party/ffmpeg/libavformat/avc.h b/chromium/third_party/ffmpeg/libavformat/avc.h
index c5e80ff650d..a79bf9b2db5 100644
--- a/chromium/third_party/ffmpeg/libavformat/avc.h
+++ b/chromium/third_party/ffmpeg/libavformat/avc.h
@@ -33,5 +33,20 @@ int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size);
const uint8_t *ff_avc_mp4_find_startcode(const uint8_t *start,
const uint8_t *end,
int nal_length_size);
+uint8_t *ff_nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len,
+ uint32_t *dst_len, int header_len);
+
+typedef struct {
+ uint8_t id;
+ uint8_t profile_idc;
+ uint8_t level_idc;
+ uint8_t constraint_set_flags;
+ uint8_t chroma_format_idc;
+ uint8_t bit_depth_luma;
+ uint8_t frame_mbs_only_flag;
+ AVRational sar;
+} H264SequenceParameterSet;
+
+H264SequenceParameterSet *ff_avc_decode_sps(const uint8_t *src, int src_len);
#endif /* AVFORMAT_AVC_H */
diff --git a/chromium/third_party/ffmpeg/libavformat/avidec.c b/chromium/third_party/ffmpeg/libavformat/avidec.c
index bae9220a766..1d887b1cc98 100644
--- a/chromium/third_party/ffmpeg/libavformat/avidec.c
+++ b/chromium/third_party/ffmpeg/libavformat/avidec.c
@@ -456,7 +456,7 @@ static int calculate_bitrate(AVFormatContext *s)
continue;
duration = st->index_entries[j-1].timestamp - st->index_entries[0].timestamp;
bitrate = av_rescale(8*len, st->time_base.den, duration * st->time_base.num);
- if (bitrate <= INT_MAX && bitrate > 0) {
+ if (bitrate > 0) {
st->codecpar->bit_rate = bitrate;
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/aviobuf.c b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
index 5a33f82950c..6a5cd97b0aa 100644
--- a/chromium/third_party/ffmpeg/libavformat/aviobuf.c
+++ b/chromium/third_party/ffmpeg/libavformat/aviobuf.c
@@ -570,7 +570,7 @@ static void fill_buffer(AVIOContext *s)
}
/* make buffer smaller in case it ended up large after probing */
- if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size) {
+ if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size && len >= s->orig_buffer_size) {
if (dst == s->buffer && s->buf_ptr != dst) {
int ret = ffio_set_buf_size(s, s->orig_buffer_size);
if (ret < 0)
@@ -578,7 +578,6 @@ static void fill_buffer(AVIOContext *s)
s->checksum_ptr = dst = s->buffer;
}
- av_assert0(len >= s->orig_buffer_size);
len = s->orig_buffer_size;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/avisynth.c b/chromium/third_party/ffmpeg/libavformat/avisynth.c
index 250a489321e..5dfe94ae0c1 100644
--- a/chromium/third_party/ffmpeg/libavformat/avisynth.c
+++ b/chromium/third_party/ffmpeg/libavformat/avisynth.c
@@ -123,7 +123,8 @@ static av_cold int avisynth_load_library(void)
return AVERROR_UNKNOWN;
#define LOAD_AVS_FUNC(name, continue_on_fail) \
- avs_library.name = dlsym(avs_library.library, #name); \
+ avs_library.name = (name ## _func) \
+ dlsym(avs_library.library, #name); \
if (!continue_on_fail && !avs_library.name) \
goto fail;
@@ -323,6 +324,10 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->codecpar->format = AV_PIX_FMT_YUVA420P10;
planar = 4;
break;
+ case AVS_CS_YUVA422P12:
+ st->codecpar->format = AV_PIX_FMT_YUVA422P12;
+ planar = 4;
+ break;
case AVS_CS_YUVA444P16:
st->codecpar->format = AV_PIX_FMT_YUVA444P16;
planar = 4;
@@ -356,6 +361,11 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->codecpar->format = AV_PIX_FMT_GBRP16;
planar = 3;
break;
+ /* Single precision floating point Planar RGB (AviSynth+) */
+ case AVS_CS_RGBPS:
+ st->codecpar->format = AV_PIX_FMT_GBRPF32;
+ planar = 3;
+ break;
/* Planar RGB pix_fmts with Alpha (AviSynth+) */
case AVS_CS_RGBAP:
st->codecpar->format = AV_PIX_FMT_GBRAP;
@@ -373,11 +383,33 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->codecpar->format = AV_PIX_FMT_GBRAP16;
planar = 5;
break;
- /* GRAY16 (AviSynth+) */
+ /* Single precision floating point Planar RGB with Alpha (AviSynth+) */
+ case AVS_CS_RGBAPS:
+ st->codecpar->format = AV_PIX_FMT_GBRAPF32;
+ planar = 5;
+ break;
+ /* 10~16-bit gray pix_fmts (AviSynth+) */
+ case AVS_CS_Y10:
+ st->codecpar->format = AV_PIX_FMT_GRAY10;
+ planar = 2;
+ break;
+ case AVS_CS_Y12:
+ st->codecpar->format = AV_PIX_FMT_GRAY12;
+ planar = 2;
+ break;
+ case AVS_CS_Y14:
+ st->codecpar->format = AV_PIX_FMT_GRAY14;
+ planar = 2;
+ break;
case AVS_CS_Y16:
st->codecpar->format = AV_PIX_FMT_GRAY16;
planar = 2;
break;
+ /* Single precision floating point gray (AviSynth+) */
+ case AVS_CS_Y32:
+ st->codecpar->format = AV_PIX_FMT_GRAYF32;
+ planar = 2;
+ break;
/* pix_fmts added in AviSynth 2.6 */
case AVS_CS_YV24:
st->codecpar->format = AV_PIX_FMT_YUV444P;
diff --git a/chromium/third_party/ffmpeg/libavformat/cache.c b/chromium/third_party/ffmpeg/libavformat/cache.c
index 66bbbf54c9a..3425be9350e 100644
--- a/chromium/third_party/ffmpeg/libavformat/cache.c
+++ b/chromium/third_party/ffmpeg/libavformat/cache.c
@@ -54,6 +54,7 @@ typedef struct CacheEntry {
typedef struct Context {
AVClass *class;
int fd;
+ char *filename;
struct AVTreeNode *root;
int64_t logical_pos;
int64_t cache_pos;
@@ -72,6 +73,7 @@ static int cmp(const void *key, const void *node)
static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
{
+ int ret;
char *buffername;
Context *c= h->priv_data;
@@ -83,8 +85,12 @@ static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **
return c->fd;
}
- unlink(buffername);
- av_freep(&buffername);
+ ret = unlink(buffername);
+
+ if (ret >= 0)
+ av_freep(&buffername);
+ else
+ c->filename = buffername;
return ffurl_open_whitelist(&c->inner, arg, flags, &h->interrupt_callback,
options, h->protocol_whitelist, h->protocol_blacklist, h);
@@ -292,11 +298,18 @@ static int enu_free(void *opaque, void *elem)
static int cache_close(URLContext *h)
{
Context *c= h->priv_data;
+ int ret;
av_log(h, AV_LOG_INFO, "Statistics, cache hits:%"PRId64" cache misses:%"PRId64"\n",
c->cache_hit, c->cache_miss);
close(c->fd);
+ if (c->filename) {
+ ret = unlink(c->filename);
+ if (ret < 0)
+ av_log(h, AV_LOG_ERROR, "Could not delete %s.\n", c->filename);
+ av_freep(&c->filename);
+ }
ffurl_close(c->inner);
av_tree_enumerate(c->root, NULL, NULL, enu_free);
av_tree_destroy(c->root);
diff --git a/chromium/third_party/ffmpeg/libavformat/dashdec.c b/chromium/third_party/ffmpeg/libavformat/dashdec.c
index 6e3e7e4f1e9..f82a750d6fa 100644
--- a/chromium/third_party/ffmpeg/libavformat/dashdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/dashdec.c
@@ -709,8 +709,8 @@ static int parse_manifest_segmenttimeline(AVFormatContext *s, struct representat
return 0;
}
-static int resolve_content_path(AVFormatContext *s, const char *url, int *max_url_size, xmlNodePtr *baseurl_nodes, int n_baseurl_nodes) {
-
+static int resolve_content_path(AVFormatContext *s, const char *url, int *max_url_size, xmlNodePtr *baseurl_nodes, int n_baseurl_nodes)
+{
char *tmp_str = NULL;
char *path = NULL;
char *mpdName = NULL;
@@ -719,7 +719,6 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur
char *root_url = NULL;
char *text = NULL;
char *tmp = NULL;
-
int isRootHttp = 0;
char token ='/';
int start = 0;
@@ -842,7 +841,7 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
xmlNodePtr representation_segmenttemplate_node = NULL;
xmlNodePtr representation_baseurl_node = NULL;
xmlNodePtr representation_segmentlist_node = NULL;
- xmlNodePtr segmentlists_tab[2];
+ xmlNodePtr segmentlists_tab[3];
xmlNodePtr fragment_timeline_node = NULL;
xmlNodePtr fragment_templates_tab[5];
char *duration_val = NULL;
@@ -1003,9 +1002,10 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url,
xmlNodePtr fragmenturl_node = NULL;
segmentlists_tab[0] = representation_segmentlist_node;
segmentlists_tab[1] = adaptionset_segmentlist_node;
+ segmentlists_tab[2] = period_segmentlist_node;
- duration_val = get_val_from_nodes_tab(segmentlists_tab, 2, "duration");
- timescale_val = get_val_from_nodes_tab(segmentlists_tab, 2, "timescale");
+ duration_val = get_val_from_nodes_tab(segmentlists_tab, 3, "duration");
+ timescale_val = get_val_from_nodes_tab(segmentlists_tab, 3, "timescale");
if (duration_val) {
rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 10);
av_log(s, AV_LOG_TRACE, "rep->fragment_duration = [%"PRId64"]\n", rep->fragment_duration);
@@ -1489,10 +1489,8 @@ static void move_segments(struct representation *rep_src, struct representation
static int refresh_manifest(AVFormatContext *s)
{
-
int ret = 0, i;
DASHContext *c = s->priv_data;
-
// save current context
int n_videos = c->n_videos;
struct representation **videos = c->videos;
@@ -1687,6 +1685,7 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen
url = av_mallocz(c->max_url_size);
if (!url) {
+ ret = AVERROR(ENOMEM);
goto cleanup;
}
@@ -1701,9 +1700,6 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen
av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset %"PRId64", playlist %d\n",
url, seg->url_offset, pls->rep_idx);
ret = open_url(pls->parent, &pls->input, url, c->avio_opts, opts, NULL);
- if (ret < 0) {
- goto cleanup;
- }
cleanup:
av_free(url);
@@ -1793,8 +1789,8 @@ restart:
ret = open_input(c, v, v->cur_seg);
if (ret < 0) {
if (ff_check_interrupt(c->interrupt_callback)) {
- goto end;
ret = AVERROR_EXIT;
+ goto end;
}
av_log(v->parent, AV_LOG_WARNING, "Failed to open fragment of playlist %d\n", v->rep_idx);
v->cur_seq_no++;
@@ -1836,7 +1832,9 @@ end:
static int save_avio_options(AVFormatContext *s)
{
DASHContext *c = s->priv_data;
- const char *opts[] = { "headers", "user_agent", "cookies", NULL }, **opt = opts;
+ const char *opts[] = {
+ "headers", "user_agent", "cookies", "http_proxy", "referer", "rw_timeout", NULL };
+ const char **opt = opts;
uint8_t *buf = NULL;
int ret = 0;
@@ -1943,7 +1941,6 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation
pls->ctx->streams[i]->r_frame_rate = pls->framerate;
}
#endif
-
ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;
@@ -1977,7 +1974,7 @@ static int open_demux_for_component(AVFormatContext *s, struct representation *p
goto fail;
}
st->id = i;
- avcodec_parameters_copy(st->codecpar, pls->ctx->streams[i]->codecpar);
+ avcodec_parameters_copy(st->codecpar, ist->codecpar);
avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den);
}
@@ -2008,19 +2005,26 @@ static int is_common_init_section_exist(struct representation **pls, int n_pls)
return 1;
}
-static void copy_init_section(struct representation *rep_dest, struct representation *rep_src)
+static int copy_init_section(struct representation *rep_dest, struct representation *rep_src)
{
rep_dest->init_sec_buf = av_mallocz(rep_src->init_sec_buf_size);
+ if (!rep_dest->init_sec_buf) {
+ av_log(rep_dest->ctx, AV_LOG_WARNING, "Cannot alloc memory for init_sec_buf\n");
+ return AVERROR(ENOMEM);
+ }
memcpy(rep_dest->init_sec_buf, rep_src->init_sec_buf, rep_src->init_sec_data_len);
rep_dest->init_sec_buf_size = rep_src->init_sec_buf_size;
rep_dest->init_sec_data_len = rep_src->init_sec_data_len;
rep_dest->cur_timestamp = rep_src->cur_timestamp;
+
+ return 0;
}
static int dash_read_header(AVFormatContext *s)
{
DASHContext *c = s->priv_data;
+ struct representation *rep;
int ret = 0;
int stream_index = 0;
int i;
@@ -2046,15 +2050,17 @@ static int dash_read_header(AVFormatContext *s)
/* Open the demuxer for video and audio components if available */
for (i = 0; i < c->n_videos; i++) {
- struct representation *cur_video = c->videos[i];
+ rep = c->videos[i];
if (i > 0 && c->is_init_section_common_video) {
- copy_init_section(cur_video,c->videos[0]);
+ ret = copy_init_section(rep, c->videos[0]);
+ if (ret < 0)
+ goto fail;
}
- ret = open_demux_for_component(s, cur_video);
+ ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
- cur_video->stream_index = stream_index;
+ rep->stream_index = stream_index;
++stream_index;
}
@@ -2062,15 +2068,17 @@ static int dash_read_header(AVFormatContext *s)
c->is_init_section_common_audio = is_common_init_section_exist(c->audios, c->n_audios);
for (i = 0; i < c->n_audios; i++) {
- struct representation *cur_audio = c->audios[i];
+ rep = c->audios[i];
if (i > 0 && c->is_init_section_common_audio) {
- copy_init_section(cur_audio,c->audios[0]);
+ ret = copy_init_section(rep, c->audios[0]);
+ if (ret < 0)
+ goto fail;
}
- ret = open_demux_for_component(s, cur_audio);
+ ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
- cur_audio->stream_index = stream_index;
+ rep->stream_index = stream_index;
++stream_index;
}
@@ -2078,19 +2086,20 @@ static int dash_read_header(AVFormatContext *s)
c->is_init_section_common_audio = is_common_init_section_exist(c->subtitles, c->n_subtitles);
for (i = 0; i < c->n_subtitles; i++) {
- struct representation *cur_subtitle = c->subtitles[i];
+ rep = c->subtitles[i];
if (i > 0 && c->is_init_section_common_audio) {
- copy_init_section(cur_subtitle,c->subtitles[0]);
+ ret = copy_init_section(rep, c->subtitles[0]);
+ if (ret < 0)
+ goto fail;
}
- ret = open_demux_for_component(s, cur_subtitle);
+ ret = open_demux_for_component(s, rep);
if (ret)
goto fail;
- cur_subtitle->stream_index = stream_index;
+ rep->stream_index = stream_index;
++stream_index;
}
-
if (!stream_index) {
ret = AVERROR_INVALIDDATA;
goto fail;
@@ -2105,33 +2114,30 @@ static int dash_read_header(AVFormatContext *s)
}
for (i = 0; i < c->n_videos; i++) {
- struct representation *pls = c->videos[i];
-
- av_program_add_stream_index(s, 0, pls->stream_index);
- pls->assoc_stream = s->streams[pls->stream_index];
- if (pls->bandwidth > 0)
- av_dict_set_int(&pls->assoc_stream->metadata, "variant_bitrate", pls->bandwidth, 0);
- if (pls->id[0])
- av_dict_set(&pls->assoc_stream->metadata, "id", pls->id, 0);
+ rep = c->videos[i];
+ av_program_add_stream_index(s, 0, rep->stream_index);
+ rep->assoc_stream = s->streams[rep->stream_index];
+ if (rep->bandwidth > 0)
+ av_dict_set_int(&rep->assoc_stream->metadata, "variant_bitrate", rep->bandwidth, 0);
+ if (rep->id[0])
+ av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
}
for (i = 0; i < c->n_audios; i++) {
- struct representation *pls = c->audios[i];
-
- av_program_add_stream_index(s, 0, pls->stream_index);
- pls->assoc_stream = s->streams[pls->stream_index];
- if (pls->bandwidth > 0)
- av_dict_set_int(&pls->assoc_stream->metadata, "variant_bitrate", pls->bandwidth, 0);
- if (pls->id[0])
- av_dict_set(&pls->assoc_stream->metadata, "id", pls->id, 0);
+ rep = c->audios[i];
+ av_program_add_stream_index(s, 0, rep->stream_index);
+ rep->assoc_stream = s->streams[rep->stream_index];
+ if (rep->bandwidth > 0)
+ av_dict_set_int(&rep->assoc_stream->metadata, "variant_bitrate", rep->bandwidth, 0);
+ if (rep->id[0])
+ av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
}
for (i = 0; i < c->n_subtitles; i++) {
- struct representation *pls = c->subtitles[i];
- av_program_add_stream_index(s, 0, pls->stream_index);
- pls->assoc_stream = s->streams[pls->stream_index];
- if (pls->id[0])
- av_dict_set(&pls->assoc_stream->metadata, "id", pls->id, 0);
+ rep = c->subtitles[i];
+ av_program_add_stream_index(s, 0, rep->stream_index);
+ rep->assoc_stream = s->streams[rep->stream_index];
+ if (rep->id[0])
+ av_dict_set(&rep->assoc_stream->metadata, "id", rep->id, 0);
}
-
}
return 0;
@@ -2145,8 +2151,8 @@ static void recheck_discard_flags(AVFormatContext *s, struct representation **p,
for (i = 0; i < n; i++) {
struct representation *pls = p[i];
-
int needed = !pls->assoc_stream || pls->assoc_stream->discard < AVDISCARD_ALL;
+
if (needed && !pls->ctx) {
pls->cur_seg_offset = 0;
pls->init_sec_buf_read_offset = 0;
@@ -2171,37 +2177,38 @@ static int dash_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret = 0, i;
int64_t mints = 0;
struct representation *cur = NULL;
+ struct representation *rep = NULL;
recheck_discard_flags(s, c->videos, c->n_videos);
recheck_discard_flags(s, c->audios, c->n_audios);
recheck_discard_flags(s, c->subtitles, c->n_subtitles);
for (i = 0; i < c->n_videos; i++) {
- struct representation *pls = c->videos[i];
- if (!pls->ctx)
+ rep = c->videos[i];
+ if (!rep->ctx)
continue;
- if (!cur || pls->cur_timestamp < mints) {
- cur = pls;
- mints = pls->cur_timestamp;
+ if (!cur || rep->cur_timestamp < mints) {
+ cur = rep;
+ mints = rep->cur_timestamp;
}
}
for (i = 0; i < c->n_audios; i++) {
- struct representation *pls = c->audios[i];
- if (!pls->ctx)
+ rep = c->audios[i];
+ if (!rep->ctx)
continue;
- if (!cur || pls->cur_timestamp < mints) {
- cur = pls;
- mints = pls->cur_timestamp;
+ if (!cur || rep->cur_timestamp < mints) {
+ cur = rep;
+ mints = rep->cur_timestamp;
}
}
for (i = 0; i < c->n_subtitles; i++) {
- struct representation *pls = c->subtitles[i];
- if (!pls->ctx)
+ rep = c->subtitles[i];
+ if (!rep->ctx)
continue;
- if (!cur || pls->cur_timestamp < mints) {
- cur = pls;
- mints = pls->cur_timestamp;
+ if (!cur || rep->cur_timestamp < mints) {
+ cur = rep;
+ mints = rep->cur_timestamp;
}
}
@@ -2233,7 +2240,6 @@ static int dash_close(AVFormatContext *s)
DASHContext *c = s->priv_data;
free_audio_list(c);
free_video_list(c);
-
av_dict_free(&c->avio_opts);
av_freep(&c->base_url);
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/dashenc.c b/chromium/third_party/ffmpeg/libavformat/dashenc.c
index b88d4b34960..b25afb40aa4 100644
--- a/chromium/third_party/ffmpeg/libavformat/dashenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/dashenc.c
@@ -89,6 +89,7 @@ typedef struct OutputStream {
int bit_rate;
SegmentType segment_type; /* segment type selected for this particular stream */
const char *format_name;
+ const char *extension_name;
const char *single_file_name; /* file names selected for this particular stream */
const char *init_seg_name;
const char *media_seg_name;
@@ -217,6 +218,16 @@ static const char *get_format_str(SegmentType segment_type) {
return NULL;
}
+static const char *get_extension_str(SegmentType type, int single_file)
+{
+ switch (type) {
+
+ case SEGMENT_TYPE_MP4: return single_file ? "mp4" : "m4s";
+ case SEGMENT_TYPE_WEBM: return "webm";
+ default: return NULL;
+ }
+}
+
static int handle_io_open_error(AVFormatContext *s, int err, char *url) {
DASHContext *c = s->priv_data;
char errbuf[AV_ERROR_MAX_STRING_SIZE];
@@ -254,6 +265,12 @@ static int init_segment_types(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "Could not select DASH segment type for stream %d\n", i);
return AVERROR_MUXER_NOT_FOUND;
}
+ os->extension_name = get_extension_str(segment_type, c->single_file);
+ if (!os->extension_name) {
+ av_log(s, AV_LOG_ERROR, "Could not get extension type for stream %d\n", i);
+ return AVERROR_MUXER_NOT_FOUND;
+ }
+
has_mp4_streams |= segment_type == SEGMENT_TYPE_MP4;
}
@@ -471,7 +488,7 @@ static void write_hls_media_playlist(OutputStream *os, AVFormatContext *s,
}
ff_hls_write_playlist_header(c->m3u8_out, 6, -1, target_duration,
- start_number, PLAYLIST_TYPE_NONE);
+ start_number, PLAYLIST_TYPE_NONE, 0);
ff_hls_write_init_file(c->m3u8_out, os->initfile, c->single_file,
os->init_range_length, os->init_start_pos);
@@ -491,7 +508,7 @@ static void write_hls_media_playlist(OutputStream *os, AVFormatContext *s,
(double) seg->duration / timescale, 0,
seg->range_length, seg->start_pos, NULL,
c->single_file ? os->initfile : seg->file,
- &prog_date_time);
+ &prog_date_time, 0, 0, 0);
if (ret < 0) {
av_log(os->ctx, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");
}
@@ -1179,17 +1196,17 @@ static int dash_init(AVFormatContext *s)
return AVERROR(ENOMEM);
if (c->init_seg_name) {
- os->init_seg_name = av_strireplace(c->init_seg_name, "$ext$", os->format_name);
+ os->init_seg_name = av_strireplace(c->init_seg_name, "$ext$", os->extension_name);
if (!os->init_seg_name)
return AVERROR(ENOMEM);
}
if (c->media_seg_name) {
- os->media_seg_name = av_strireplace(c->media_seg_name, "$ext$", os->format_name);
+ os->media_seg_name = av_strireplace(c->media_seg_name, "$ext$", os->extension_name);
if (!os->media_seg_name)
return AVERROR(ENOMEM);
}
if (c->single_file_name) {
- os->single_file_name = av_strireplace(c->single_file_name, "$ext$", os->format_name);
+ os->single_file_name = av_strireplace(c->single_file_name, "$ext$", os->extension_name);
if (!os->single_file_name)
return AVERROR(ENOMEM);
}
@@ -1611,11 +1628,11 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
for (i = 0; i < s->nb_streams; i++) {
OutputStream *os = &c->streams[i];
if (os->ctx && os->ctx_inited) {
- int file_size = avio_tell(os->ctx->pb);
+ int64_t file_size = avio_tell(os->ctx->pb);
av_write_trailer(os->ctx);
if (c->global_sidx) {
int j, start_index, start_number;
- int sidx_size = avio_tell(os->ctx->pb) - file_size;
+ int64_t sidx_size = avio_tell(os->ctx->pb) - file_size;
get_start_index_number(os, c, &start_index, &start_number);
if (start_index >= os->nb_segments ||
os->segment_type != SEGMENT_TYPE_MP4)
diff --git a/chromium/third_party/ffmpeg/libavformat/dump.c b/chromium/third_party/ffmpeg/libavformat/dump.c
index bb8c72fc608..1c446560710 100644
--- a/chromium/third_party/ffmpeg/libavformat/dump.c
+++ b/chromium/third_party/ffmpeg/libavformat/dump.c
@@ -547,8 +547,16 @@ static void dump_stream_format(AVFormatContext *ic, int i,
av_log(NULL, AV_LOG_INFO, " (visual impaired)");
if (st->disposition & AV_DISPOSITION_CLEAN_EFFECTS)
av_log(NULL, AV_LOG_INFO, " (clean effects)");
+ if (st->disposition & AV_DISPOSITION_ATTACHED_PIC)
+ av_log(NULL, AV_LOG_INFO, " (attached pic)");
+ if (st->disposition & AV_DISPOSITION_TIMED_THUMBNAILS)
+ av_log(NULL, AV_LOG_INFO, " (timed thumbnails)");
+ if (st->disposition & AV_DISPOSITION_CAPTIONS)
+ av_log(NULL, AV_LOG_INFO, " (captions)");
if (st->disposition & AV_DISPOSITION_DESCRIPTIONS)
av_log(NULL, AV_LOG_INFO, " (descriptions)");
+ if (st->disposition & AV_DISPOSITION_METADATA)
+ av_log(NULL, AV_LOG_INFO, " (metadata)");
if (st->disposition & AV_DISPOSITION_DEPENDENT)
av_log(NULL, AV_LOG_INFO, " (dependent)");
if (st->disposition & AV_DISPOSITION_STILL_IMAGE)
diff --git a/chromium/third_party/ffmpeg/libavformat/flvenc.c b/chromium/third_party/ffmpeg/libavformat/flvenc.c
index e4863f1fc73..fb1dede7aed 100644
--- a/chromium/third_party/ffmpeg/libavformat/flvenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/flvenc.c
@@ -653,11 +653,9 @@ end:
return ret;
}
-
-static int flv_write_header(AVFormatContext *s)
+static int flv_init(struct AVFormatContext *s)
{
int i;
- AVIOContext *pb = s->pb;
FLVContext *flv = s->priv_data;
for (i = 0; i < s->nb_streams; i++) {
@@ -736,6 +734,15 @@ static int flv_write_header(AVFormatContext *s)
flv->delay = AV_NOPTS_VALUE;
+ return 0;
+}
+
+static int flv_write_header(AVFormatContext *s)
+{
+ int i;
+ AVIOContext *pb = s->pb;
+ FLVContext *flv = s->priv_data;
+
avio_write(pb, "FLV", 3);
avio_w8(pb, 1);
avio_w8(pb, FLV_HEADER_FLAG_HASAUDIO * !!flv->audio_par +
@@ -1074,6 +1081,18 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
return pb->error;
}
+static int flv_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
+{
+ int ret = 1;
+ AVStream *st = s->streams[pkt->stream_index];
+
+ if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
+ if (pkt->size > 2 && (AV_RB16(pkt->data) & 0xfff0) == 0xfff0)
+ ret = ff_stream_add_bitstream_filter(st, "aac_adtstoasc", NULL);
+ }
+ return ret;
+}
+
static const AVOption options[] = {
{ "flvflags", "FLV muxer flags", offsetof(FLVContext, flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
{ "aac_seq_header_detect", "Put AAC sequence header based on stream data", 0, AV_OPT_TYPE_CONST, {.i64 = FLV_AAC_SEQ_HEADER_DETECT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "flvflags" },
@@ -1099,9 +1118,11 @@ AVOutputFormat ff_flv_muxer = {
.priv_data_size = sizeof(FLVContext),
.audio_codec = CONFIG_LIBMP3LAME ? AV_CODEC_ID_MP3 : AV_CODEC_ID_ADPCM_SWF,
.video_codec = AV_CODEC_ID_FLV1,
+ .init = flv_init,
.write_header = flv_write_header,
.write_packet = flv_write_packet,
.write_trailer = flv_write_trailer,
+ .check_bitstream= flv_check_bitstream,
.codec_tag = (const AVCodecTag* const []) {
flv_video_codec_ids, flv_audio_codec_ids, 0
},
diff --git a/chromium/third_party/ffmpeg/libavformat/gif.c b/chromium/third_party/ffmpeg/libavformat/gif.c
index 7916ba1e6b2..e125d386bd2 100644
--- a/chromium/third_party/ffmpeg/libavformat/gif.c
+++ b/chromium/third_party/ffmpeg/libavformat/gif.c
@@ -174,6 +174,9 @@ static int gif_write_trailer(AVFormatContext *s)
GIFContext *gif = s->priv_data;
AVIOContext *pb = s->pb;
+ if (!gif->prev_pkt)
+ return AVERROR(EINVAL);
+
gif_write_packet(s, NULL);
if (!gif->have_end)
diff --git a/chromium/third_party/ffmpeg/libavformat/hevc.c b/chromium/third_party/ffmpeg/libavformat/hevc.c
index 3628d5a0282..c7c4be34416 100644
--- a/chromium/third_party/ffmpeg/libavformat/hevc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hevc.c
@@ -643,40 +643,6 @@ static int hvcc_parse_pps(GetBitContext *gb,
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 + AV_INPUT_BUFFER_PADDING_SIZE);
- 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++];
-
- memset(dst + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);
-
- *dst_len = len;
- return dst;
-}
-
-
-
static void nal_unit_parse_header(GetBitContext *gb, uint8_t *nal_type)
{
skip_bits1(gb); // forbidden_zero_bit
@@ -753,7 +719,7 @@ static int hvcc_add_nal_unit(uint8_t *nal_buf, uint32_t nal_size,
uint8_t *rbsp_buf;
uint32_t rbsp_size;
- rbsp_buf = nal_unit_extract_rbsp(nal_buf, nal_size, &rbsp_size);
+ rbsp_buf = ff_nal_unit_extract_rbsp(nal_buf, nal_size, &rbsp_size, 2);
if (!rbsp_buf) {
ret = AVERROR(ENOMEM);
goto end;
diff --git a/chromium/third_party/ffmpeg/libavformat/hls.c b/chromium/third_party/ffmpeg/libavformat/hls.c
index 1b61b4b5c0d..8c12fcef77b 100644
--- a/chromium/third_party/ffmpeg/libavformat/hls.c
+++ b/chromium/third_party/ffmpeg/libavformat/hls.c
@@ -203,7 +203,6 @@ typedef struct HLSContext {
int64_t cur_timestamp;
AVIOInterruptCB *interrupt_callback;
AVDictionary *avio_opts;
- int strict_std_compliance;
char *allowed_extensions;
int max_reload;
int http_persistent;
@@ -292,7 +291,7 @@ static void free_rendition_list(HLSContext *c)
}
/*
- * Used to reset a statically allocated AVPacket to a clean slate,
+ * Used to reset a statically allocated AVPacket to a clean state,
* containing no data.
*/
static void reset_packet(AVPacket *pkt)
@@ -477,17 +476,23 @@ static struct rendition *new_rendition(HLSContext *c, struct rendition_info *inf
* AVC SEI RBSP anyway */
return NULL;
- if (type == AVMEDIA_TYPE_UNKNOWN)
+ if (type == AVMEDIA_TYPE_UNKNOWN) {
+ av_log(c, AV_LOG_WARNING, "Can't support the type: %s\n", info->type);
return NULL;
+ }
/* URI is mandatory for subtitles as per spec */
- if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0])
+ if (type == AVMEDIA_TYPE_SUBTITLE && !info->uri[0]) {
+ av_log(c, AV_LOG_ERROR, "The URI tag is REQUIRED for subtitle.\n");
return NULL;
+ }
/* TODO: handle subtitles (each segment has to parsed separately) */
- if (c->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
- if (type == AVMEDIA_TYPE_SUBTITLE)
+ if (c->ctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL)
+ if (type == AVMEDIA_TYPE_SUBTITLE) {
+ av_log(c, AV_LOG_WARNING, "Can't support the subtitle(uri: %s)\n", info->uri);
return NULL;
+ }
rend = av_mallocz(sizeof(struct rendition));
if (!rend)
@@ -844,6 +849,7 @@ static int parse_playlist(HLSContext *c, const char *url,
if (ptr)
seg_offset = strtoll(ptr+1, NULL, 10);
} else if (av_strstart(line, "#", NULL)) {
+ av_log(c->ctx, AV_LOG_INFO, "Skip ('%s')\n", line);
continue;
} else if (line[0]) {
if (is_variant) {
@@ -1203,12 +1209,12 @@ static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg,
if (open_url(pls->parent, &pb, seg->key, c->avio_opts, opts, NULL) == 0) {
ret = avio_read(pb, pls->key, sizeof(pls->key));
if (ret != sizeof(pls->key)) {
- av_log(NULL, AV_LOG_ERROR, "Unable to read key file %s\n",
+ av_log(pls->parent, AV_LOG_ERROR, "Unable to read key file %s\n",
seg->key);
}
ff_format_io_close(pls->parent, &pb);
} else {
- av_log(NULL, AV_LOG_ERROR, "Unable to open key file %s\n",
+ av_log(pls->parent, AV_LOG_ERROR, "Unable to open key file %s\n",
seg->key);
}
av_strlcpy(pls->key_url, seg->key, sizeof(pls->key_url));
@@ -1393,8 +1399,8 @@ restart:
v->needed = playlist_needed(v);
if (!v->needed) {
- av_log(v->parent, AV_LOG_INFO, "No longer receiving playlist %d\n",
- v->index);
+ av_log(v->parent, AV_LOG_INFO, "No longer receiving playlist %d ('%s')\n",
+ v->index, v->url);
return AVERROR_EOF;
}
@@ -1420,7 +1426,7 @@ reload:
reload_interval = v->target_duration / 2;
}
if (v->cur_seq_no < v->start_seq_no) {
- av_log(NULL, AV_LOG_WARNING,
+ av_log(v->parent, AV_LOG_WARNING,
"skipping %d segments ahead, expired from playlists\n",
v->start_seq_no - v->cur_seq_no);
v->cur_seq_no = v->start_seq_no;
@@ -1468,7 +1474,7 @@ reload:
uint8_t *http_version_opt = NULL;
int r = av_opt_get(v->input, "http_version", AV_OPT_SEARCH_CHILDREN, &http_version_opt);
if (r >= 0) {
- c->http_multiple = strncmp((const char *)http_version_opt, "1.1", 3) == 0;
+ c->http_multiple = (!strncmp((const char *)http_version_opt, "1.1", 3) || !strncmp((const char *)http_version_opt, "2.0", 3));
av_freep(&http_version_opt);
}
}
@@ -1786,7 +1792,6 @@ static int hls_read_header(AVFormatContext *s)
c->ctx = s;
c->interrupt_callback = &s->interrupt_callback;
- c->strict_std_compliance = s->strict_std_compliance;
c->first_packet = 1;
c->first_timestamp = AV_NOPTS_VALUE;
@@ -1802,7 +1807,7 @@ static int hls_read_header(AVFormatContext *s)
goto fail;
if (c->n_variants == 0) {
- av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+ av_log(s, AV_LOG_WARNING, "Empty playlist\n");
ret = AVERROR_EOF;
goto fail;
}
@@ -1817,7 +1822,7 @@ static int hls_read_header(AVFormatContext *s)
}
if (c->variants[0]->playlists[0]->n_segments == 0) {
- av_log(NULL, AV_LOG_WARNING, "Empty playlist\n");
+ av_log(s, AV_LOG_WARNING, "Empty segment\n");
ret = AVERROR_EOF;
goto fail;
}
@@ -1944,7 +1949,7 @@ static int hls_read_header(AVFormatContext *s)
* but for other streams we can rely on our user calling avformat_find_stream_info()
* on us if they want to.
*/
- if (pls->is_id3_timestamped) {
+ if (pls->is_id3_timestamped || (pls->n_renditions > 0 && pls->renditions[0]->type == AVMEDIA_TYPE_AUDIO)) {
ret = avformat_find_stream_info(pls->ctx, NULL);
if (ret < 0)
goto fail;
diff --git a/chromium/third_party/ffmpeg/libavformat/hlsenc.c b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
index 6b913be31c2..4abc728a898 100644
--- a/chromium/third_party/ffmpeg/libavformat/hlsenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/hlsenc.c
@@ -64,17 +64,19 @@ typedef enum {
} CodecAttributeStatus;
#define KEYSIZE 16
-#define LINE_BUFFER_SIZE 1024
+#define LINE_BUFFER_SIZE MAX_URL_SIZE
#define HLS_MICROSECOND_UNIT 1000000
#define POSTFIX_PATTERN "_%d"
typedef struct HLSSegment {
- char filename[1024];
- char sub_filename[1024];
+ char filename[MAX_URL_SIZE];
+ char sub_filename[MAX_URL_SIZE];
double duration; /* in seconds */
int discont;
int64_t pos;
int64_t size;
+ int64_t keyframe_pos;
+ int64_t keyframe_size;
unsigned var_stream_idx;
char key_uri[LINE_BUFFER_SIZE + 1];
@@ -99,6 +101,7 @@ typedef enum HLSFlags {
HLS_TEMP_FILE = (1 << 11),
HLS_PERIODIC_REKEY = (1 << 12),
HLS_INDEPENDENT_SEGMENTS = (1 << 13),
+ HLS_I_FRAMES_ONLY = (1 << 14),
} HLSFlags;
typedef enum {
@@ -125,6 +128,9 @@ typedef struct VariantStream {
double dpp; // duration per packet
int64_t start_pts;
int64_t end_pts;
+ int64_t video_lastpos;
+ int64_t video_keyframe_pos;
+ int64_t video_keyframe_size;
double duration; // last segment duration computed so far, in seconds
int64_t start_pos; // last segment starting position
int64_t size; // last segment size
@@ -143,7 +149,7 @@ typedef struct VariantStream {
char *m3u8_name;
double initial_prog_date_time;
- char current_segment_final_filename_fmt[1024]; // when renaming segments
+ char current_segment_final_filename_fmt[MAX_URL_SIZE]; // when renaming segments
char *fmp4_init_filename;
char *base_output_dirname;
@@ -158,6 +164,7 @@ typedef struct VariantStream {
char *agroup; /* audio group name */
char *ccgroup; /* closed caption group name */
char *baseurl;
+ char *varname; // variant name
} VariantStream;
typedef struct ClosedCaptionsStream {
@@ -230,6 +237,7 @@ typedef struct HLSContext {
AVIOContext *sub_m3u8_out;
int64_t timeout;
int ignore_io_errors;
+ char *headers;
int has_default_key; /* has DEFAULT field of var_stream_map */
int has_video_m3u8; /* has video stream m3u8 list */
} HLSContext;
@@ -287,6 +295,8 @@ static void set_http_options(AVFormatContext *s, AVDictionary **options, HLSCont
av_dict_set_int(options, "multiple_requests", 1, 0);
if (c->timeout >= 0)
av_dict_set_int(options, "timeout", c->timeout, 0);
+ if (c->headers)
+ av_dict_set(options, "headers", c->headers, 0);
}
static void write_codec_attr(AVStream *st, VariantStream *vs) {
@@ -334,6 +344,47 @@ fail:
return;
}
+static int replace_str_data_in_filename(char **s, const char *filename, char placeholder, const char *datastring)
+{
+ const char *p;
+ char *new_filename;
+ char c;
+ int addchar_count;
+ int found_count = 0;
+ AVBPrint buf;
+
+ av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
+
+ p = filename;
+ for (;;) {
+ c = *p;
+ if (c == '\0')
+ break;
+ if (c == '%' && *(p+1) == '%') // %%
+ addchar_count = 2;
+ else if (c == '%' && *(p+1) == placeholder) {
+ av_bprintf(&buf, "%s", datastring);
+ p += 2;
+ addchar_count = 0;
+ found_count ++;
+ } else
+ addchar_count = 1;
+
+ if (addchar_count > 0) {
+ av_bprint_append_data(&buf, p, addchar_count);
+ p += addchar_count;
+ }
+ }
+ if (!av_bprint_is_complete(&buf)) {
+ av_bprint_finalize(&buf, NULL);
+ return -1;
+ }
+ if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename)
+ return -1;
+ *s = new_filename;
+ return found_count;
+}
+
static int replace_int_data_in_filename(char **s, const char *filename, char placeholder, int64_t number)
{
const char *p;
@@ -468,20 +519,27 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
}
- while (segment) {
+ /* if %v is present in the file's directory
+ * all segment belongs to the same variant, so do it only once before the loop*/
+ if (dirname && av_stristr(dirname, "%v")) {
char * r_dirname = dirname;
-
- /* if %v is present in the file's directory */
- if (dirname && av_stristr(dirname, "%v")) {
-
+ if (!vs->varname) {
if (replace_int_data_in_filename(&r_dirname, dirname, 'v', segment->var_stream_idx) < 1) {
ret = AVERROR(EINVAL);
goto fail;
}
- av_free(dirname);
- dirname = r_dirname;
+ } else {
+ if (replace_str_data_in_filename(&r_dirname, dirname, 'v', vs->varname) < 1) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
}
+ av_free(dirname);
+ dirname = r_dirname;
+ }
+
+ while (segment) {
av_log(hls, AV_LOG_DEBUG, "deleting old segment %s\n",
segment->filename);
path_size = (hls->use_localtime_mkdir ? 0 : strlen(dirname)) + strlen(segment->filename) + 1;
@@ -994,6 +1052,8 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls,
en->duration = duration;
en->pos = pos;
en->size = size;
+ en->keyframe_pos = vs->video_keyframe_pos;
+ en->keyframe_size = vs->video_keyframe_size;
en->next = NULL;
en->discont = 0;
@@ -1051,7 +1111,7 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs
AVIOContext *in;
int ret = 0, is_segment = 0;
int64_t new_start_pos;
- char line[1024];
+ char line[MAX_URL_SIZE];
const char *ptr;
const char *end;
@@ -1203,8 +1263,12 @@ static int create_master_playlist(AVFormatContext *s,
AVDictionary *options = NULL;
unsigned int i, j;
int m3u8_name_size, ret, bandwidth;
- char *m3u8_rel_name, *ccgroup;
+ char *m3u8_rel_name = NULL, *ccgroup;
ClosedCaptionsStream *ccs;
+ const char *proto = avio_find_protocol_name(hls->master_m3u8_url);
+ int is_file_proto = proto && !strcmp(proto, "file");
+ int use_temp_file = is_file_proto && ((hls->flags & HLS_TEMP_FILE) || hls->master_publish_rate);
+ char temp_filename[MAX_URL_SIZE];
input_vs->m3u8_created = 1;
if (!hls->master_m3u8_created) {
@@ -1220,12 +1284,12 @@ static int create_master_playlist(AVFormatContext *s,
}
set_http_options(s, &options, hls);
-
- ret = hlsenc_io_open(s, &hls->m3u8_out, hls->master_m3u8_url, &options);
+ snprintf(temp_filename, sizeof(temp_filename), use_temp_file ? "%s.tmp" : "%s", hls->master_m3u8_url);
+ ret = hlsenc_io_open(s, &hls->m3u8_out, temp_filename, &options);
av_dict_free(&options);
if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Failed to open master play list file '%s'\n",
- hls->master_m3u8_url);
+ temp_filename);
goto fail;
}
@@ -1356,7 +1420,10 @@ fail:
if(ret >=0)
hls->master_m3u8_created = 1;
av_freep(&m3u8_rel_name);
- hlsenc_io_close(s, &hls->m3u8_out, hls->master_m3u8_url);
+ hlsenc_io_close(s, &hls->m3u8_out, temp_filename);
+ if (use_temp_file)
+ ff_rename(temp_filename, hls->master_m3u8_url, s);
+
return ret;
}
@@ -1364,9 +1431,11 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
{
HLSContext *hls = s->priv_data;
HLSSegment *en;
+ AVFormatContext *oc = vs->avf;
int target_duration = 0;
int ret = 0;
- char temp_filename[1024];
+ char temp_filename[MAX_URL_SIZE];
+ char temp_vtt_filename[MAX_URL_SIZE];
int64_t sequence = FFMAX(hls->start_sequence, vs->sequence - vs->nb_entries);
const char *proto = avio_find_protocol_name(vs->m3u8_name);
int is_file_proto = proto && !strcmp(proto, "file");
@@ -1398,7 +1467,7 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
set_http_options(s, &options, hls);
snprintf(temp_filename, sizeof(temp_filename), use_temp_file ? "%s.tmp" : "%s", vs->m3u8_name);
- if ((ret = hlsenc_io_open(s, &hls->m3u8_out, temp_filename, &options)) < 0) {
+ if ((ret = hlsenc_io_open(s, byterange_mode ? &hls->m3u8_out : &oc->pb, temp_filename, &options)) < 0) {
if (hls->ignore_io_errors)
ret = 0;
goto fail;
@@ -1410,56 +1479,57 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
}
vs->discontinuity_set = 0;
- ff_hls_write_playlist_header(hls->m3u8_out, hls->version, hls->allowcache,
- target_duration, sequence, hls->pl_type);
+ ff_hls_write_playlist_header(byterange_mode ? hls->m3u8_out : oc->pb, hls->version, hls->allowcache,
+ target_duration, sequence, hls->pl_type, hls->flags & HLS_I_FRAMES_ONLY);
if((hls->flags & HLS_DISCONT_START) && sequence==hls->start_sequence && vs->discontinuity_set==0 ){
- avio_printf(hls->m3u8_out, "#EXT-X-DISCONTINUITY\n");
+ avio_printf(byterange_mode ? hls->m3u8_out : oc->pb, "#EXT-X-DISCONTINUITY\n");
vs->discontinuity_set = 1;
}
if (vs->has_video && (hls->flags & HLS_INDEPENDENT_SEGMENTS)) {
- avio_printf(hls->m3u8_out, "#EXT-X-INDEPENDENT-SEGMENTS\n");
+ avio_printf(byterange_mode ? hls->m3u8_out : oc->pb, "#EXT-X-INDEPENDENT-SEGMENTS\n");
}
for (en = vs->segments; en; en = en->next) {
if ((hls->encrypt || hls->key_info_file) && (!key_uri || strcmp(en->key_uri, key_uri) ||
av_strcasecmp(en->iv_string, iv_string))) {
- avio_printf(hls->m3u8_out, "#EXT-X-KEY:METHOD=AES-128,URI=\"%s\"", en->key_uri);
+ avio_printf(byterange_mode ? hls->m3u8_out : oc->pb, "#EXT-X-KEY:METHOD=AES-128,URI=\"%s\"", en->key_uri);
if (*en->iv_string)
- avio_printf(hls->m3u8_out, ",IV=0x%s", en->iv_string);
- avio_printf(hls->m3u8_out, "\n");
+ avio_printf(byterange_mode ? hls->m3u8_out : oc->pb, ",IV=0x%s", en->iv_string);
+ avio_printf(byterange_mode ? hls->m3u8_out : oc->pb, "\n");
key_uri = en->key_uri;
iv_string = en->iv_string;
}
if ((hls->segment_type == SEGMENT_TYPE_FMP4) && (en == vs->segments)) {
- ff_hls_write_init_file(hls->m3u8_out, (hls->flags & HLS_SINGLE_FILE) ? en->filename : vs->fmp4_init_filename,
+ ff_hls_write_init_file(byterange_mode ? hls->m3u8_out : oc->pb, (hls->flags & HLS_SINGLE_FILE) ? en->filename : vs->fmp4_init_filename,
hls->flags & HLS_SINGLE_FILE, vs->init_range_length, 0);
}
- ret = ff_hls_write_file_entry(hls->m3u8_out, en->discont, byterange_mode,
+ ret = ff_hls_write_file_entry(byterange_mode ? hls->m3u8_out : oc->pb, en->discont, byterange_mode,
en->duration, hls->flags & HLS_ROUND_DURATIONS,
en->size, en->pos, vs->baseurl,
- en->filename, prog_date_time_p);
+ en->filename, prog_date_time_p, en->keyframe_size, en->keyframe_pos, hls->flags & HLS_I_FRAMES_ONLY);
if (ret < 0) {
av_log(s, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");
}
}
if (last && (hls->flags & HLS_OMIT_ENDLIST)==0)
- ff_hls_write_end_list(hls->m3u8_out);
+ ff_hls_write_end_list(byterange_mode ? hls->m3u8_out : oc->pb);
- if( vs->vtt_m3u8_name ) {
- if ((ret = hlsenc_io_open(s, &hls->sub_m3u8_out, vs->vtt_m3u8_name, &options)) < 0) {
+ if (vs->vtt_m3u8_name) {
+ snprintf(temp_vtt_filename, sizeof(temp_vtt_filename), use_temp_file ? "%s.tmp" : "%s", vs->vtt_m3u8_name);
+ if ((ret = hlsenc_io_open(s, &hls->sub_m3u8_out, temp_vtt_filename, &options)) < 0) {
if (hls->ignore_io_errors)
ret = 0;
goto fail;
}
ff_hls_write_playlist_header(hls->sub_m3u8_out, hls->version, hls->allowcache,
- target_duration, sequence, PLAYLIST_TYPE_NONE);
+ target_duration, sequence, PLAYLIST_TYPE_NONE, 0);
for (en = vs->segments; en; en = en->next) {
ret = ff_hls_write_file_entry(hls->sub_m3u8_out, 0, byterange_mode,
en->duration, 0, en->size, en->pos,
- vs->baseurl, en->sub_filename, NULL);
+ vs->baseurl, en->sub_filename, NULL, 0, 0, 0);
if (ret < 0) {
av_log(s, AV_LOG_WARNING, "ff_hls_write_file_entry get error\n");
}
@@ -1472,10 +1542,13 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs)
fail:
av_dict_free(&options);
- hlsenc_io_close(s, &hls->m3u8_out, temp_filename);
+ hlsenc_io_close(s, byterange_mode ? &hls->m3u8_out : &oc->pb, temp_filename);
hlsenc_io_close(s, &hls->sub_m3u8_out, vs->vtt_m3u8_name);
- if (use_temp_file)
+ if (use_temp_file) {
ff_rename(temp_filename, vs->m3u8_name, s);
+ if (vs->vtt_m3u8_name)
+ ff_rename(temp_vtt_filename, vs->vtt_m3u8_name, s);
+ }
if (ret >= 0 && hls->master_pl_name)
if (create_master_playlist(s, vs) < 0)
av_log(s, AV_LOG_WARNING, "Master playlist creation failed\n");
@@ -1522,7 +1595,7 @@ static int hls_start(AVFormatContext *s, VariantStream *vs)
if (c->use_localtime) {
time_t now0;
struct tm *tm, tmpbuf;
- int bufsize = strlen(vs->basename) + 1024;
+ int bufsize = strlen(vs->basename) + MAX_URL_SIZE;
char *buf = av_mallocz(bufsize);
if (!buf)
return AVERROR(ENOMEM);
@@ -1735,15 +1808,15 @@ static int validate_name(int nb_vs, const char *fn)
subdir_name = av_dirname(fn_dup);
if (nb_vs > 1 && !av_stristr(filename, "%v") && !av_stristr(subdir_name, "%v")) {
- av_log(NULL, AV_LOG_ERROR, "More than 1 variant streams are present, %%v is expected in the filename %s\n",
- fn);
+ av_log(NULL, AV_LOG_ERROR, "More than 1 variant streams are present, %%v is expected "
+ "either in the filename or in the sub-directory name of file %s\n", fn);
ret = AVERROR(EINVAL);
goto fail;
}
if (av_stristr(filename, "%v") && av_stristr(subdir_name, "%v")) {
- av_log(NULL, AV_LOG_ERROR, "%%v is expected either in filename or in the sub-directory name of file %s\n",
- fn);
+ av_log(NULL, AV_LOG_ERROR, "%%v is expected either in the filename or "
+ "in the sub-directory name of file %s, but only in one of them\n", fn);
ret = AVERROR(EINVAL);
goto fail;
}
@@ -1753,33 +1826,41 @@ fail:
return ret;
}
-static int format_name(char *buf, int buf_len, int index)
+static int format_name(const char *buf, char **s, int index, const char *varname)
{
const char *proto, *dir;
- char *orig_buf_dup = NULL, *mod_buf = NULL, *mod_buf_dup = NULL;
+ char *orig_buf_dup = NULL, *mod_buf_dup = NULL;
int ret = 0;
- if (!av_stristr(buf, "%v"))
- return ret;
-
orig_buf_dup = av_strdup(buf);
if (!orig_buf_dup) {
ret = AVERROR(ENOMEM);
goto fail;
}
- if (replace_int_data_in_filename(&mod_buf, orig_buf_dup, 'v', index) < 1) {
- ret = AVERROR(EINVAL);
- goto fail;
+ if (!av_stristr(buf, "%v")) {
+ *s = orig_buf_dup;
+ return ret;
+ }
+
+ if (!varname) {
+ if (replace_int_data_in_filename(s, orig_buf_dup, 'v', index) < 1) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
+ } else {
+ if (replace_str_data_in_filename(s, orig_buf_dup, 'v', varname) < 1) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
}
- av_strlcpy(buf, mod_buf, buf_len);
proto = avio_find_protocol_name(orig_buf_dup);
dir = av_dirname(orig_buf_dup);
/* if %v is present in the file's directory, create sub-directory */
if (av_stristr(dir, "%v") && proto && !strcmp(proto, "file")) {
- mod_buf_dup = av_strdup(buf);
+ mod_buf_dup = av_strdup(*s);
if (!mod_buf_dup) {
ret = AVERROR(ENOMEM);
goto fail;
@@ -1795,7 +1876,6 @@ static int format_name(char *buf, int buf_len, int index)
fail:
av_freep(&orig_buf_dup);
av_freep(&mod_buf_dup);
- av_freep(&mod_buf);
return ret;
}
@@ -1821,7 +1901,7 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
{
HLSContext *hls = s->priv_data;
VariantStream *vs;
- int stream_index;
+ int stream_index, i, j;
enum AVMediaType codec_type;
int nb_varstreams, nb_streams;
char *p, *q, *saveptr1, *saveptr2, *varstr, *keyval;
@@ -1830,7 +1910,7 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
/**
* Expected format for var_stream_map string is as below:
* "a:0,v:0 a:1,v:1"
- * "a:0,agroup:a0,default:1,language:ENG a:1,agroup:a1,defalut:0 v:0,agroup:a0 v:1,agroup:a1"
+ * "a:0,agroup:a0,default:1,language:ENG a:1,agroup:a1,default:0 v:0,agroup:a0 v:1,agroup:a1"
* This string specifies how to group the audio, video and subtitle streams
* into different variant streams. The variant stream groups are separated
* by space.
@@ -1890,6 +1970,11 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
(!av_strncasecmp(val, "1", strlen("1"))));
hls->has_default_key = 1;
continue;
+ } else if (av_strstart(keyval, "name:", &val)) {
+ vs->varname = av_strdup(val);
+ if (!vs->varname)
+ return AVERROR(ENOMEM);
+ continue;
} else if (av_strstart(keyval, "agroup:", &val)) {
vs->agroup = av_strdup(val);
if (!vs->agroup)
@@ -1918,6 +2003,23 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
atoi(val));
if (stream_index >= 0 && nb_streams < vs->nb_streams) {
+ for(i = 0; nb_streams > 0 && i < nb_streams; i++) {
+ if (vs->streams[i] == s->streams[stream_index]) {
+ av_log(s, AV_LOG_ERROR, "Same elementary stream found more than once inside "
+ "variant definition #%d\n", nb_varstreams - 1);
+ return AVERROR(EINVAL);
+ }
+ }
+ for(j = 0; nb_varstreams > 1 && j < nb_varstreams - 1; j++) {
+ for(i = 0; i < hls->var_streams[j].nb_streams; i++) {
+ if (hls->var_streams[j].streams[i] == s->streams[stream_index]) {
+ av_log(s, AV_LOG_ERROR, "Same elementary stream found more than once "
+ "in two different variant definitions #%d and #%d\n",
+ j, nb_varstreams - 1);
+ return AVERROR(EINVAL);
+ }
+ }
+ }
vs->streams[nb_streams++] = s->streams[stream_index];
} else {
av_log(s, AV_LOG_ERROR, "Unable to map stream at %s\n", keyval);
@@ -2205,7 +2307,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
vs->start_pts = pkt->pts;
}
- if (vs->has_video) {
+ if (vs->has_video) {
can_split = st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
((pkt->flags & AV_PKT_FLAG_KEY) || (hls->flags & HLS_SPLIT_BY_TIME));
is_ref_pkt = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && (pkt->stream_index == vs->reference_stream_index);
@@ -2240,6 +2342,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
av_write_frame(vs->avf, NULL); /* Flush any buffered data */
new_start_pos = avio_tell(vs->avf->pb);
+
if (hls->segment_type != SEGMENT_TYPE_FMP4) {
avio_flush(oc->pb);
vs->size = new_start_pos - vs->start_pos;
@@ -2333,6 +2436,12 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
} else {
vs->start_pos += vs->size;
}
+ // if we're building a VOD playlist, skip writing the manifest multiple times, and just wait until the end
+ if (hls->pl_type != PLAYLIST_TYPE_VOD) {
+ if ((ret = hls_window(s, 0, vs)) < 0) {
+ return ret;
+ }
+ }
if (hls->flags & HLS_SINGLE_FILE) {
vs->number++;
@@ -2357,17 +2466,18 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
- // if we're building a VOD playlist, skip writing the manifest multiple times, and just wait until the end
- if (hls->pl_type != PLAYLIST_TYPE_VOD) {
- if ((ret = hls_window(s, 0, vs)) < 0) {
- return ret;
- }
- }
}
vs->packets_written++;
if (oc->pb) {
ret = ff_write_chained(oc, stream_index, pkt, s, 0);
+ if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && (pkt->flags & AV_PKT_FLAG_KEY)) {
+ vs->video_keyframe_size = avio_tell(oc->pb) - vs->video_lastpos;
+ vs->video_keyframe_pos = vs->start_pos;
+ } else {
+ vs->video_lastpos = avio_tell(oc->pb);
+ }
+
if (hls->ignore_io_errors)
ret = 0;
}
@@ -2401,6 +2511,7 @@ static void hls_free_variant_streams(struct HLSContext *hls)
av_freep(&vs->language);
av_freep(&vs->ccgroup);
av_freep(&vs->baseurl);
+ av_freep(&vs->varname);
}
}
@@ -2475,7 +2586,7 @@ failed:
if (oc->pb) {
if (hls->segment_type != SEGMENT_TYPE_FMP4) {
vs->size = avio_tell(vs->avf->pb) - vs->start_pos;
- ff_format_io_close(s, &oc->pb);
+ hlsenc_io_close(s, &vs->avf->pb, vs->avf->url);
}
// rename that segment from .tmp to the real one
@@ -2502,10 +2613,10 @@ failed:
ff_format_io_close(s, &vtt_oc->pb);
avformat_free_context(vtt_oc);
}
+ hls_window(s, 1, vs);
avformat_free_context(oc);
vs->avf = NULL;
- hls_window(s, 1, vs);
av_free(old_filename);
}
@@ -2613,12 +2724,7 @@ static int hls_init(AVFormatContext *s)
for (i = 0; i < hls->nb_varstreams; i++) {
vs = &hls->var_streams[i];
- vs->m3u8_name = av_strdup(s->url);
- if (!vs->m3u8_name ) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
- ret = format_name(vs->m3u8_name, strlen(s->url) + 1, i);
+ ret = format_name(s->url, &vs->m3u8_name, i, vs->varname);
if (ret < 0)
goto fail;
@@ -2679,17 +2785,10 @@ static int hls_init(AVFormatContext *s)
}
}
if (hls->segment_filename) {
- basename_size = strlen(hls->segment_filename) + 1;
- vs->basename = av_malloc(basename_size);
- if (!vs->basename) {
- ret = AVERROR(ENOMEM);
- goto fail;
- }
-
- av_strlcpy(vs->basename, hls->segment_filename, basename_size);
- ret = format_name(vs->basename, basename_size, i);
+ ret = format_name(hls->segment_filename, &vs->basename, i, vs->varname);
if (ret < 0)
goto fail;
+ basename_size = strlen(vs->basename) + 1;
} else {
if (hls->flags & HLS_SINGLE_FILE) {
if (hls->segment_type == SEGMENT_TYPE_FMP4) {
@@ -2742,7 +2841,8 @@ static int hls_init(AVFormatContext *s)
fmp4_init_filename_len);
if (hls->nb_varstreams > 1) {
if (av_stristr(vs->fmp4_init_filename, "%v")) {
- format_name(vs->fmp4_init_filename, fmp4_init_filename_len, i);
+ av_freep(&vs->fmp4_init_filename);
+ format_name(hls->fmp4_init_filename, &vs->fmp4_init_filename, i, vs->varname);
} else {
ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i);
}
@@ -2806,8 +2906,8 @@ static int hls_init(AVFormatContext *s)
*p = '\0';
if ( hls->subtitle_filename ) {
- strcpy(vs->vtt_m3u8_name, hls->subtitle_filename);
- ret = format_name(vs->vtt_m3u8_name, vtt_basename_size, i);
+ av_freep(&vs->vtt_m3u8_name);
+ ret = format_name(hls->subtitle_filename, &vs->vtt_m3u8_name, i, vs->varname);
if (ret < 0)
goto fail;
} else {
@@ -2858,6 +2958,7 @@ fail:
av_freep(&vs->agroup);
av_freep(&vs->ccgroup);
av_freep(&vs->baseurl);
+ av_freep(&vs->varname);
if (vs->avf)
avformat_free_context(vs->avf);
if (vs->vtt_avf)
@@ -2906,7 +3007,7 @@ static const AVOption options[] = {
{"hls_fmp4_init_filename", "set fragment mp4 file init filename", OFFSET(fmp4_init_filename), AV_OPT_TYPE_STRING, {.str = "init.mp4"}, 0, 0, E},
{"hls_flags", "set flags affecting HLS playlist and media file generation", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, 0, UINT_MAX, E, "flags"},
{"single_file", "generate a single media file indexed with byte ranges", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_SINGLE_FILE }, 0, UINT_MAX, E, "flags"},
- {"temp_file", "write segment to temporary file and rename when complete", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_TEMP_FILE }, 0, UINT_MAX, E, "flags"},
+ {"temp_file", "write segment and playlist to temporary file and rename when complete", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_TEMP_FILE }, 0, UINT_MAX, E, "flags"},
{"delete_segments", "delete segment files that are no longer part of the playlist", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_DELETE_SEGMENTS }, 0, UINT_MAX, E, "flags"},
{"round_durations", "round durations in m3u8 to whole numbers", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_ROUND_DURATIONS }, 0, UINT_MAX, E, "flags"},
{"discont_start", "start the playlist with a discontinuity tag", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_DISCONT_START }, 0, UINT_MAX, E, "flags"},
@@ -2919,6 +3020,7 @@ static const AVOption options[] = {
{"second_level_segment_size", "include segment size in segment filenames when use_localtime", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_SECOND_LEVEL_SEGMENT_SIZE }, 0, UINT_MAX, E, "flags"},
{"periodic_rekey", "reload keyinfo file periodically for re-keying", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_PERIODIC_REKEY }, 0, UINT_MAX, E, "flags"},
{"independent_segments", "add EXT-X-INDEPENDENT-SEGMENTS, whenever applicable", 0, AV_OPT_TYPE_CONST, { .i64 = HLS_INDEPENDENT_SEGMENTS }, 0, UINT_MAX, E, "flags"},
+ {"iframes_only", "add EXT-X-I-FRAMES-ONLY, whenever applicable", 0, AV_OPT_TYPE_CONST, { .i64 = HLS_I_FRAMES_ONLY }, 0, UINT_MAX, E, "flags"},
#if FF_API_HLS_USE_LOCALTIME
{"use_localtime", "set filename expansion with strftime at segment creation(will be deprecated )", OFFSET(use_localtime), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E },
#endif
@@ -2943,6 +3045,7 @@ static const AVOption options[] = {
{"http_persistent", "Use persistent HTTP connections", OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E },
{"timeout", "set timeout for socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX, .flags = E },
{"ignore_io_errors", "Ignore IO errors for stable long-duration runs with network output", OFFSET(ignore_io_errors), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
+ {"headers", "set custom HTTP headers, can override built in default headers", OFFSET(headers), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
{ NULL },
};
diff --git a/chromium/third_party/ffmpeg/libavformat/hlsplaylist.c b/chromium/third_party/ffmpeg/libavformat/hlsplaylist.c
index 0537049a978..e8b566789c9 100644
--- a/chromium/third_party/ffmpeg/libavformat/hlsplaylist.c
+++ b/chromium/third_party/ffmpeg/libavformat/hlsplaylist.c
@@ -76,7 +76,7 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
int target_duration, int64_t sequence,
- uint32_t playlist_type) {
+ uint32_t playlist_type, int iframe_mode) {
if (!out)
return;
ff_hls_write_playlist_version(out, version);
@@ -92,6 +92,9 @@ void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
} else if (playlist_type == PLAYLIST_TYPE_VOD) {
avio_printf(out, "#EXT-X-PLAYLIST-TYPE:VOD\n");
}
+ if (iframe_mode) {
+ avio_printf(out, "#EXT-X-I-FRAMES-ONLY\n");
+ }
}
void ff_hls_write_init_file(AVIOContext *out, char *filename,
@@ -108,7 +111,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
double duration, int round_duration,
int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
char *baseurl, //Ignored if NULL
- char *filename, double *prog_date_time) {
+ char *filename, double *prog_date_time,
+ int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode) {
if (!out || !filename)
return AVERROR(EINVAL);
@@ -120,7 +124,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
else
avio_printf(out, "#EXTINF:%f,\n", duration);
if (byterange_mode)
- avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", size, pos);
+ avio_printf(out, "#EXT-X-BYTERANGE:%"PRId64"@%"PRId64"\n", iframe_mode ? video_keyframe_size : size,
+ iframe_mode ? video_keyframe_pos : pos);
if (prog_date_time) {
time_t tt, wrongsecs;
diff --git a/chromium/third_party/ffmpeg/libavformat/hlsplaylist.h b/chromium/third_party/ffmpeg/libavformat/hlsplaylist.h
index 54c93a39639..8d2d83b661e 100644
--- a/chromium/third_party/ffmpeg/libavformat/hlsplaylist.h
+++ b/chromium/third_party/ffmpeg/libavformat/hlsplaylist.h
@@ -44,7 +44,7 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
char *codecs, char *ccgroup);
void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
int target_duration, int64_t sequence,
- uint32_t playlist_type);
+ uint32_t playlist_type, int iframe_mode);
void ff_hls_write_init_file(AVIOContext *out, char *filename,
int byterange_mode, int64_t size, int64_t pos);
int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
@@ -52,7 +52,8 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
double duration, int round_duration,
int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
char *baseurl, //Ignored if NULL
- char *filename, double *prog_date_time);
+ char *filename, double *prog_date_time,
+ int64_t video_keyframe_size, int64_t video_keyframe_pos, int iframe_mode);
void ff_hls_write_end_list (AVIOContext *out);
#endif /* AVFORMAT_HLSPLAYLIST_H_ */
diff --git a/chromium/third_party/ffmpeg/libavformat/http.c b/chromium/third_party/ffmpeg/libavformat/http.c
index 5a937994cfc..579debcd355 100644
--- a/chromium/third_party/ffmpeg/libavformat/http.c
+++ b/chromium/third_party/ffmpeg/libavformat/http.c
@@ -1638,7 +1638,7 @@ static int http_shutdown(URLContext *h, int flags)
read_ret = ffurl_read(s->hd, buf, sizeof(buf));
s->hd->flags &= ~AVIO_FLAG_NONBLOCK;
if (read_ret < 0 && read_ret != AVERROR(EAGAIN)) {
- av_log(h, AV_LOG_ERROR, "URL read error: %d\n", read_ret);
+ av_log(h, AV_LOG_ERROR, "URL read error: %s\n", av_err2str(read_ret));
ret = read_ret;
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/icodec.c b/chromium/third_party/ffmpeg/libavformat/icodec.c
index f9b0015f348..98684e5e742 100644
--- a/chromium/third_party/ffmpeg/libavformat/icodec.c
+++ b/chromium/third_party/ffmpeg/libavformat/icodec.c
@@ -96,8 +96,10 @@ static int read_header(AVFormatContext *s)
break;
st = avformat_new_stream(s, NULL);
- if (!st)
+ if (!st) {
+ av_freep(&ico->images);
return AVERROR(ENOMEM);
+ }
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
st->codecpar->width = avio_r8(pb);
@@ -111,6 +113,7 @@ static int read_header(AVFormatContext *s)
ico->images[i].size = avio_rl32(pb);
if (ico->images[i].size <= 0) {
av_log(s, AV_LOG_ERROR, "Invalid image size %d\n", ico->images[i].size);
+ av_freep(&ico->images);
return AVERROR_INVALIDDATA;
}
ico->images[i].offset = avio_rl32(pb);
@@ -126,8 +129,10 @@ static int read_header(AVFormatContext *s)
st->codecpar->height = 0;
break;
case 40:
- if (ico->images[i].size < 40)
+ if (ico->images[i].size < 40) {
+ av_freep(&ico->images);
return AVERROR_INVALIDDATA;
+ }
st->codecpar->codec_id = AV_CODEC_ID_BMP;
tmp = avio_rl32(pb);
if (tmp)
@@ -138,6 +143,7 @@ static int read_header(AVFormatContext *s)
break;
default:
avpriv_request_sample(s, "codec %d", codec);
+ av_freep(&ico->images);
return AVERROR_INVALIDDATA;
}
}
diff --git a/chromium/third_party/ffmpeg/libavformat/id3v2enc.c b/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
index ffe358f0198..c13b93a7d86 100644
--- a/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/id3v2enc.c
@@ -255,6 +255,42 @@ static int write_metadata(AVIOContext *pb, AVDictionary **metadata,
return 0;
}
+static int write_ctoc(AVFormatContext *s, ID3v2EncContext *id3, int enc)
+{
+ uint8_t *dyn_buf = NULL;
+ AVIOContext *dyn_bc = NULL;
+ char name[123];
+ int len, ret;
+
+ if (s->nb_chapters == 0)
+ return 0;
+
+ if ((ret = avio_open_dyn_buf(&dyn_bc)) < 0)
+ goto fail;
+
+ id3->len += avio_put_str(dyn_bc, "toc");
+ avio_w8(dyn_bc, 0x03);
+ avio_w8(dyn_bc, s->nb_chapters);
+ for (int i = 0; i < s->nb_chapters; i++) {
+ snprintf(name, 122, "ch%d", i);
+ id3->len += avio_put_str(dyn_bc, name);
+ }
+ len = avio_close_dyn_buf(dyn_bc, &dyn_buf);
+ id3->len += 16 + ID3v2_HEADER_SIZE;
+
+ avio_wb32(s->pb, MKBETAG('C', 'T', 'O', 'C'));
+ avio_wb32(s->pb, len);
+ avio_wb16(s->pb, 0);
+ avio_write(s->pb, dyn_buf, len);
+
+fail:
+ if (dyn_bc && !dyn_buf)
+ avio_close_dyn_buf(dyn_bc, &dyn_buf);
+ av_freep(&dyn_buf);
+
+ return ret;
+}
+
static int write_chapter(AVFormatContext *s, ID3v2EncContext *id3, int id, int enc)
{
const AVRational time_base = {1, 1000};
@@ -306,6 +342,9 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3)
if ((ret = write_metadata(s->pb, &s->metadata, id3, enc)) < 0)
return ret;
+ if ((ret = write_ctoc(s, id3, enc)) < 0)
+ return ret;
+
for (i = 0; i < s->nb_chapters; i++) {
if ((ret = write_chapter(s, id3, i, enc)) < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/ifv.c b/chromium/third_party/ffmpeg/libavformat/ifv.c
new file mode 100644
index 00000000000..6acbb29a759
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavformat/ifv.c
@@ -0,0 +1,307 @@
+/*
+ * IFV demuxer
+ *
+ * Copyright (c) 2019 Swaraj Hota
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "internal.h"
+#include "avio_internal.h"
+
+typedef struct IFVContext {
+ uint32_t next_video_index;
+ uint32_t next_audio_index;
+ uint32_t total_vframes;
+ uint32_t total_aframes;
+
+ int width, height;
+ int is_audio_present;
+ int sample_rate;
+
+ int video_stream_index;
+ int audio_stream_index;
+} IFVContext;
+
+static int ifv_probe(const AVProbeData *p)
+{
+ static const uint8_t ifv_magic[] = {0x11, 0xd2, 0xd3, 0xab, 0xba, 0xa9,
+ 0xcf, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65, 0x44};
+
+ if (!memcmp(p->buf, ifv_magic, sizeof(ifv_magic)))
+ return AVPROBE_SCORE_MAX;
+
+ return 0;
+}
+
+static int read_index(AVFormatContext *s,
+ enum AVMediaType frame_type,
+ uint32_t start_index)
+{
+ IFVContext *ifv = s->priv_data;
+ AVStream *st;
+ int64_t pos, size, timestamp;
+ uint32_t end_index, i;
+ int ret;
+
+ if (frame_type == AVMEDIA_TYPE_VIDEO) {
+ end_index = ifv->total_vframes;
+ st = s->streams[ifv->video_stream_index];
+ } else {
+ end_index = ifv->total_aframes;
+ st = s->streams[ifv->audio_stream_index];
+ }
+
+ for (i = start_index; i < end_index; i++) {
+ pos = avio_rl32(s->pb);
+ size = avio_rl32(s->pb);
+
+ avio_skip(s->pb, 8);
+ timestamp = avio_rl32(s->pb);
+
+ ret = av_add_index_entry(st, pos, timestamp, size, 0, 0);
+ if (ret < 0)
+ return ret;
+
+ avio_skip(s->pb, frame_type == AVMEDIA_TYPE_VIDEO ? 8: 4);
+ }
+
+ return 0;
+}
+
+static int parse_header(AVFormatContext *s)
+{
+ IFVContext *ifv = s->priv_data;
+ uint32_t aud_magic;
+ uint32_t vid_magic;
+
+ avio_skip(s->pb, 0x34);
+ avpriv_dict_set_timestamp(&s->metadata, "creation_time", avio_rl32(s->pb) * 1000000LL);
+ avio_skip(s->pb, 0x24);
+
+ ifv->width = avio_rl16(s->pb);
+ ifv->height = avio_rl16(s->pb);
+
+ avio_skip(s->pb, 0x8);
+ vid_magic = avio_rl32(s->pb);
+
+ if (vid_magic != MKTAG('H','2','6','4'))
+ avpriv_request_sample(s, "Unknown video codec %x", vid_magic);
+
+ avio_skip(s->pb, 0x2c);
+ ifv->sample_rate = avio_rl32(s->pb);
+ aud_magic = avio_rl32(s->pb);
+
+ if (aud_magic == MKTAG('G','R','A','W')) {
+ ifv->is_audio_present = 1;
+ } else if (aud_magic == MKTAG('P','C','M','U')) {
+ ifv->is_audio_present = 0;
+ } else {
+ avpriv_request_sample(s, "Unknown audio codec %x", aud_magic);
+ }
+
+ avio_skip(s->pb, 0x44);
+ ifv->total_vframes = avio_rl32(s->pb);
+ ifv->total_aframes = avio_rl32(s->pb);
+
+ return 0;
+}
+
+static int ifv_read_header(AVFormatContext *s)
+{
+ IFVContext *ifv = s->priv_data;
+ AVStream *st;
+ int ret;
+
+ ret = parse_header(s);
+ if (ret < 0)
+ return ret;
+
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ st->codecpar->codec_id = AV_CODEC_ID_H264;
+ st->codecpar->width = ifv->width;
+ st->codecpar->height = ifv->height;
+ st->start_time = 0;
+ ifv->video_stream_index = st->index;
+
+ avpriv_set_pts_info(st, 32, 1, 1000);
+
+ if (ifv->is_audio_present) {
+ st = avformat_new_stream(s, NULL);
+ if (!st)
+ return AVERROR(ENOMEM);
+
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
+ st->codecpar->channels = 1;
+ st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->sample_rate = ifv->sample_rate;
+ ifv->audio_stream_index = st->index;
+
+ avpriv_set_pts_info(st, 32, 1, 1000);
+ }
+
+ /*read video index*/
+ avio_seek(s->pb, 0xf8, SEEK_SET);
+
+ ret = read_index(s, AVMEDIA_TYPE_VIDEO, 0);
+ if (ret < 0)
+ return ret;
+
+ if (ifv->is_audio_present) {
+ /*read audio index*/
+ avio_seek(s->pb, 0x14918, SEEK_SET);
+
+ ret = read_index(s, AVMEDIA_TYPE_AUDIO, 0);
+ if (ret < 0)
+ return ret;
+ }
+
+ ifv->next_video_index = 0;
+ ifv->next_audio_index = 0;
+
+ return 0;
+}
+
+static int ifv_read_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ IFVContext *ifv = s->priv_data;
+ AVStream *st;
+ AVIndexEntry *ev, *ea, *e_next;
+ int ret;
+
+ ev = ea = e_next = NULL;
+
+ if (ifv->next_video_index < ifv->total_vframes) {
+ st = s->streams[ifv->video_stream_index];
+ if (ifv->next_video_index < st->nb_index_entries)
+ e_next = ev = &st->index_entries[ifv->next_video_index];
+ }
+
+ if (ifv->is_audio_present &&
+ ifv->next_audio_index < ifv->total_aframes) {
+ st = s->streams[ifv->audio_stream_index];
+ if (ifv->next_audio_index < st->nb_index_entries) {
+ ea = &st->index_entries[ifv->next_audio_index];
+ if (!ev || ea->timestamp < ev->timestamp)
+ e_next = ea;
+ }
+ }
+
+ if (!ev) {
+ if (ifv->is_audio_present && !ea) {
+ /*read new video and audio indexes*/
+
+ ifv->next_video_index = ifv->total_vframes;
+ ifv->next_audio_index = ifv->total_aframes;
+
+ avio_skip(s->pb, 0x1c);
+ ifv->total_vframes += avio_rl32(s->pb);
+ ifv->total_aframes += avio_rl32(s->pb);
+ avio_skip(s->pb, 0xc);
+
+ if (avio_feof(s->pb))
+ return AVERROR_EOF;
+
+ ret = read_index(s, AVMEDIA_TYPE_VIDEO, ifv->next_video_index);
+ if (ret < 0)
+ return ret;
+
+ ret = read_index(s, AVMEDIA_TYPE_AUDIO, ifv->next_audio_index);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+
+ } else if (!ifv->is_audio_present) {
+ /*read new video index*/
+
+ ifv->next_video_index = ifv->total_vframes;
+
+ avio_skip(s->pb, 0x1c);
+ ifv->total_vframes += avio_rl32(s->pb);
+ avio_skip(s->pb, 0x10);
+
+ if (avio_feof(s->pb))
+ return AVERROR_EOF;
+
+ ret = read_index(s, AVMEDIA_TYPE_VIDEO, ifv->next_video_index);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+ }
+
+ if (!e_next) return AVERROR_EOF;
+
+ avio_seek(s->pb, e_next->pos, SEEK_SET);
+ ret = av_get_packet(s->pb, pkt, e_next->size);
+ if (ret < 0)
+ return ret;
+
+ if (e_next == ev) {
+ ifv->next_video_index++;
+ pkt->stream_index = ifv->video_stream_index;
+ } else {
+ ifv->next_audio_index++;
+ pkt->stream_index = ifv->audio_stream_index;
+ }
+
+ pkt->pts = e_next->timestamp;
+ pkt->pos = e_next->pos;
+
+ return 0;
+}
+
+static int ifv_read_seek(AVFormatContext *s, int stream_index, int64_t ts, int flags)
+{
+ IFVContext *ifv = s->priv_data;
+
+ for (unsigned i = 0; i < s->nb_streams; i++) {
+ int index = av_index_search_timestamp(s->streams[i], ts, AVSEEK_FLAG_ANY);
+ if (index < 0) {
+ ifv->next_video_index = ifv->total_vframes - 1;
+ ifv->next_audio_index = ifv->total_aframes - 1;
+ return 0;
+ }
+
+ if (i == ifv->video_stream_index) {
+ ifv->next_video_index = index;
+ } else {
+ ifv->next_audio_index = index;
+ }
+ }
+
+ return 0;
+}
+
+AVInputFormat ff_ifv_demuxer = {
+ .name = "ifv",
+ .long_name = NULL_IF_CONFIG_SMALL("IFV CCTV DVR"),
+ .priv_data_size = sizeof(IFVContext),
+ .extensions = "ifv",
+ .read_probe = ifv_probe,
+ .read_header = ifv_read_header,
+ .read_packet = ifv_read_packet,
+ .read_seek = ifv_read_seek,
+};
diff --git a/chromium/third_party/ffmpeg/libavformat/img2.c b/chromium/third_party/ffmpeg/libavformat/img2.c
index 8432cc09554..16bc9d2abd8 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2.c
@@ -51,6 +51,7 @@ const IdStrMap ff_img_tags[] = {
{ AV_CODEC_ID_TARGA, "tga" },
{ AV_CODEC_ID_TIFF, "tiff" },
{ AV_CODEC_ID_TIFF, "tif" },
+ { AV_CODEC_ID_TIFF, "dng" },
{ AV_CODEC_ID_SGI, "sgi" },
{ AV_CODEC_ID_PTX, "ptx" },
{ AV_CODEC_ID_PCX, "pcx" },
diff --git a/chromium/third_party/ffmpeg/libavformat/img2dec.c b/chromium/third_party/ffmpeg/libavformat/img2dec.c
index fe45c5e5ecd..f8b4a655a53 100644
--- a/chromium/third_party/ffmpeg/libavformat/img2dec.c
+++ b/chromium/third_party/ffmpeg/libavformat/img2dec.c
@@ -356,6 +356,7 @@ int ff_img_read_header(AVFormatContext *s1)
}
if (s1->flags & AVFMT_FLAG_CUSTOM_IO) {
avio_seek(s1->pb, 0, SEEK_SET);
+ av_freep(&probe_buffer);
} else
ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/isom.c b/chromium/third_party/ffmpeg/libavformat/isom.c
index 4358dc4a6a9..c4880878c1b 100644
--- a/chromium/third_party/ffmpeg/libavformat/isom.c
+++ b/chromium/third_party/ffmpeg/libavformat/isom.c
@@ -290,6 +290,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'R', 'A') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'R', 'G') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'Y', '2') },
+ { AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'Y', '4') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '8', 'R', 'G') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '8', 'R', 'A') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '8', 'G', '0') },
@@ -337,6 +338,7 @@ const AVCodecTag ff_codec_movaudio_tags[] = {
{ AV_CODEC_ID_MP1, MKTAG('.', 'm', 'p', '1') },
{ AV_CODEC_ID_MP2, MKTAG('.', 'm', 'p', '2') },
{ AV_CODEC_ID_MP3, MKTAG('.', 'm', 'p', '3') },
+ { AV_CODEC_ID_MP3, MKTAG('m', 'p', '3', ' ') }, /* vlc */
{ AV_CODEC_ID_MP3, 0x6D730055 },
{ AV_CODEC_ID_NELLYMOSER, MKTAG('n', 'm', 'o', 's') }, /* Flash Media Server */
{ AV_CODEC_ID_NELLYMOSER, MKTAG('N', 'E', 'L', 'L') }, /* Perian */
diff --git a/chromium/third_party/ffmpeg/libavformat/jacosubdec.c b/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
index 50144f7e214..121c86d6596 100644
--- a/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/jacosubdec.c
@@ -107,6 +107,7 @@ static const char *read_ts(JACOsubContext *jacosub, const char *buf,
unsigned hs, ms, ss, fs; // hours, minutes, seconds, frame start
unsigned he, me, se, fe; // hours, minutes, seconds, frame end
int ts_start, ts_end;
+ int64_t ts_start64, ts_end64;
/* timed format */
if (sscanf(buf, "%u:%u:%u.%u %u:%u:%u.%u %n",
@@ -124,10 +125,10 @@ static const char *read_ts(JACOsubContext *jacosub, const char *buf,
return NULL;
shift_and_ret:
- ts_start = (ts_start + jacosub->shift) * 100 / jacosub->timeres;
- ts_end = (ts_end + jacosub->shift) * 100 / jacosub->timeres;
- *start = ts_start;
- *duration = ts_end - ts_start;
+ ts_start64 = (ts_start + jacosub->shift) * 100LL / jacosub->timeres;
+ ts_end64 = (ts_end + jacosub->shift) * 100LL / jacosub->timeres;
+ *start = ts_start64;
+ *duration = ts_end64 - ts_start64;
return buf + len;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskadec.c b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
index dcb8031fec9..4453a4c501b 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskadec.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskadec.c
@@ -73,6 +73,8 @@
#include "qtpalette.h"
#define EBML_UNKNOWN_LENGTH UINT64_MAX /* EBML unknown length, in uint64_t */
+#define NEEDS_CHECKING 2 /* Indicates that some error checks
+ * still need to be performed */
typedef enum {
EBML_NONE,
@@ -83,7 +85,6 @@ typedef enum {
EBML_BIN,
EBML_NEST,
EBML_LEVEL1,
- EBML_PASS,
EBML_STOP,
EBML_SINT,
EBML_TYPE_COUNT
@@ -308,14 +309,25 @@ typedef struct MatroskaLevel {
uint64_t length;
} MatroskaLevel;
+typedef struct MatroskaBlock {
+ uint64_t duration;
+ int64_t reference;
+ uint64_t non_simple;
+ EbmlBin bin;
+ uint64_t additional_id;
+ EbmlBin additional;
+ int64_t discard_padding;
+} MatroskaBlock;
+
typedef struct MatroskaCluster {
+ MatroskaBlock block;
uint64_t timecode;
- EbmlList blocks;
+ int64_t pos;
} MatroskaCluster;
typedef struct MatroskaLevel1Element {
- uint64_t id;
uint64_t pos;
+ uint32_t id;
int parsed;
} MatroskaLevel1Element;
@@ -326,7 +338,6 @@ typedef struct MatroskaDemuxContext {
/* EBML stuff */
int num_levels;
MatroskaLevel levels[EBML_MAX_DEPTH];
- int level_up;
uint32_t current_id;
uint64_t time_scale;
@@ -361,13 +372,8 @@ typedef struct MatroskaDemuxContext {
MatroskaLevel1Element level1_elems[64];
int num_level1_elems;
- int current_cluster_num_blocks;
- int64_t current_cluster_pos;
MatroskaCluster current_cluster;
- /* File has SSA subtitles which prevent incremental cluster parsing. */
- int contains_ssa;
-
/* WebM DASH Manifest live flag */
int is_live;
@@ -375,16 +381,6 @@ typedef struct MatroskaDemuxContext {
int bandwidth;
} MatroskaDemuxContext;
-typedef struct MatroskaBlock {
- uint64_t duration;
- int64_t reference;
- uint64_t non_simple;
- EbmlBin bin;
- uint64_t additional_id;
- EbmlBin additional;
- int64_t discard_padding;
-} 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 } },
@@ -703,7 +699,6 @@ static EbmlSyntax matroska_blockadditions[] = {
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), { .i = INT64_MIN } },
@@ -712,28 +707,10 @@ static EbmlSyntax matroska_blockgroup[] = {
{ 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 },
- { 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 },
- { 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 } },
+static EbmlSyntax matroska_cluster_parsing[] = {
+ { MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) },
+ { MATROSKA_ID_BLOCKGROUP, EBML_NEST, 0, 0, { .n = matroska_blockgroup } },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock, bin) },
{ MATROSKA_ID_CLUSTERPOSITION, EBML_NONE },
{ MATROSKA_ID_CLUSTERPREVSIZE, EBML_NONE },
{ MATROSKA_ID_INFO, EBML_NONE },
@@ -744,7 +721,7 @@ static EbmlSyntax matroska_cluster_incremental_parsing[] = {
{ 0 }
};
-static EbmlSyntax matroska_cluster_incremental[] = {
+static EbmlSyntax matroska_cluster[] = {
{ MATROSKA_ID_CLUSTERTIMECODE, EBML_UINT, 0, offsetof(MatroskaCluster, timecode) },
{ MATROSKA_ID_BLOCKGROUP, EBML_STOP },
{ MATROSKA_ID_SIMPLEBLOCK, EBML_STOP },
@@ -753,8 +730,8 @@ static EbmlSyntax matroska_cluster_incremental[] = {
{ 0 }
};
-static EbmlSyntax matroska_clusters_incremental[] = {
- { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, { .n = matroska_cluster_incremental } },
+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 },
@@ -825,33 +802,32 @@ static int ebml_level_end(MatroskaDemuxContext *matroska)
* Returns: number of bytes read, < 0 on error
*/
static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
- int max_size, uint64_t *number)
+ int max_size, uint64_t *number, int eof_forbidden)
{
- int read = 1, n = 1;
- uint64_t total = 0;
+ int read, n = 1;
+ uint64_t total;
+ int64_t pos;
- /* The first byte tells us the length in bytes - avio_r8() can normally
- * return 0, but since that's not a valid first ebmlID byte, we can
- * use it safely here to catch EOS. */
- if (!(total = avio_r8(pb))) {
- /* we might encounter EOS here */
- if (!avio_feof(pb)) {
- int64_t pos = avio_tell(pb);
- av_log(matroska->ctx, AV_LOG_ERROR,
- "Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
- pos, pos);
- return pb->error ? pb->error : AVERROR(EIO);
- }
- return AVERROR_EOF;
- }
+ /* The first byte tells us the length in bytes - except when it is zero. */
+ total = avio_r8(pb);
+ if (pb->eof_reached)
+ goto err;
/* get the length of the EBML number */
read = 8 - ff_log2_tab[total];
- if (read > max_size) {
- int64_t pos = avio_tell(pb) - 1;
- av_log(matroska->ctx, AV_LOG_ERROR,
- "Invalid EBML number size tag 0x%02x at pos %"PRIu64" (0x%"PRIx64")\n",
- (uint8_t) total, pos, pos);
+
+ if (!total || read > max_size) {
+ pos = avio_tell(pb) - 1;
+ if (!total) {
+ av_log(matroska->ctx, AV_LOG_ERROR,
+ "0x00 at pos %"PRId64" (0x%"PRIx64") invalid as first byte "
+ "of an EBML number\n", pos, pos);
+ } else {
+ av_log(matroska->ctx, AV_LOG_ERROR,
+ "Length %d indicated by an EBML number's first byte 0x%02x "
+ "at pos %"PRId64" (0x%"PRIx64") exceeds max length %d.\n",
+ read, (uint8_t) total, pos, pos, max_size);
+ }
return AVERROR_INVALIDDATA;
}
@@ -860,9 +836,29 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
while (n++ < read)
total = (total << 8) | avio_r8(pb);
+ if (pb->eof_reached) {
+ eof_forbidden = 1;
+ goto err;
+ }
+
*number = total;
return read;
+
+err:
+ pos = avio_tell(pb);
+ if (pb->error) {
+ av_log(matroska->ctx, AV_LOG_ERROR,
+ "Read error at pos. %"PRIu64" (0x%"PRIx64")\n",
+ pos, pos);
+ return pb->error;
+ }
+ if (eof_forbidden) {
+ av_log(matroska->ctx, AV_LOG_ERROR, "File ended prematurely "
+ "at pos. %"PRIu64" (0x%"PRIx64")\n", pos, pos);
+ return AVERROR(EIO);
+ }
+ return AVERROR_EOF;
}
/**
@@ -873,7 +869,7 @@ static int ebml_read_num(MatroskaDemuxContext *matroska, AVIOContext *pb,
static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb,
uint64_t *number)
{
- int res = ebml_read_num(matroska, pb, 8, number);
+ int res = ebml_read_num(matroska, pb, 8, number, 1);
if (res > 0 && *number + 1 == 1ULL << (7 * res))
*number = EBML_UNKNOWN_LENGTH;
return res;
@@ -881,34 +877,28 @@ static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb,
/*
* Read the next element as an unsigned int.
- * 0 is success, < 0 is failure.
+ * Returns NEEDS_CHECKING.
*/
static int ebml_read_uint(AVIOContext *pb, int size, uint64_t *num)
{
int n = 0;
- if (size > 8)
- return AVERROR_INVALIDDATA;
-
/* big-endian ordering; build up number */
*num = 0;
while (n++ < size)
*num = (*num << 8) | avio_r8(pb);
- return 0;
+ return NEEDS_CHECKING;
}
/*
* Read the next element as a signed int.
- * 0 is success, < 0 is failure.
+ * Returns NEEDS_CHECKING.
*/
static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num)
{
int n = 1;
- if (size > 8)
- return AVERROR_INVALIDDATA;
-
if (size == 0) {
*num = 0;
} else {
@@ -919,12 +909,12 @@ static int ebml_read_sint(AVIOContext *pb, int size, int64_t *num)
*num = ((uint64_t)*num << 8) | avio_r8(pb);
}
- return 0;
+ return NEEDS_CHECKING;
}
/*
* Read the next element as a float.
- * 0 is success, < 0 is failure.
+ * Returns NEEDS_CHECKING or < 0 on obvious failure.
*/
static int ebml_read_float(AVIOContext *pb, int size, double *num)
{
@@ -937,24 +927,25 @@ static int ebml_read_float(AVIOContext *pb, int size, double *num)
else
return AVERROR_INVALIDDATA;
- return 0;
+ return NEEDS_CHECKING;
}
/*
* Read the next element as an ASCII string.
- * 0 is success, < 0 is failure.
+ * 0 is success, < 0 or NEEDS_CHECKING is failure.
*/
static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
{
char *res;
+ int ret;
/* EBML strings are usually not 0-terminated, so we allocate one
* byte more, read the string and NULL-terminate it ourselves. */
if (!(res = av_malloc(size + 1)))
return AVERROR(ENOMEM);
- if (avio_read(pb, (uint8_t *) res, size) != size) {
+ if ((ret = avio_read(pb, (uint8_t *) res, size)) != size) {
av_free(res);
- return AVERROR(EIO);
+ return ret < 0 ? ret : NEEDS_CHECKING;
}
(res)[size] = '\0';
av_free(*str);
@@ -965,7 +956,7 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
/*
* Read the next element as binary data.
- * 0 is success, < 0 is failure.
+ * 0 is success, < 0 or NEEDS_CHECKING is failure.
*/
static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
{
@@ -979,11 +970,11 @@ static int ebml_read_binary(AVIOContext *pb, int length, EbmlBin *bin)
bin->data = bin->buf->data;
bin->size = length;
bin->pos = avio_tell(pb);
- if (avio_read(pb, bin->data, length) != length) {
+ if ((ret = avio_read(pb, bin->data, length)) != length) {
av_buffer_unref(&bin->buf);
bin->data = NULL;
bin->size = 0;
- return AVERROR(EIO);
+ return ret < 0 ? ret : NEEDS_CHECKING;
}
return 0;
@@ -1021,7 +1012,7 @@ static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska,
{
AVIOContext pb;
ffio_init_context(&pb, data, size, 0, NULL, NULL, NULL, NULL);
- return ebml_read_num(matroska, &pb, FFMIN(size, 8), num);
+ return ebml_read_num(matroska, &pb, FFMIN(size, 8), num, 1);
}
/*
@@ -1068,7 +1059,7 @@ static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
{
if (!matroska->current_id) {
uint64_t id;
- int res = ebml_read_num(matroska, matroska->ctx->pb, 4, &id);
+ int res = ebml_read_num(matroska, matroska->ctx->pb, 4, &id, 0);
if (res < 0) {
// in live mode, finish parsing if EOF is reached.
return (matroska->is_live && matroska->ctx->pb->eof_reached &&
@@ -1166,6 +1157,7 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
{
static const uint64_t max_lengths[EBML_TYPE_COUNT] = {
[EBML_UINT] = 8,
+ [EBML_SINT] = 8,
[EBML_FLOAT] = 8,
// max. 16 MB for strings
[EBML_STR] = 0x1000000,
@@ -1193,7 +1185,7 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
list->nb_elem++;
}
- if (syntax->type != EBML_PASS && syntax->type != EBML_STOP) {
+ if (syntax->type != EBML_STOP) {
matroska->current_id = 0;
if ((res = ebml_read_length(matroska, pb, &length)) < 0)
return res;
@@ -1267,19 +1259,49 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
level1_elem->parsed = 1;
}
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)
- return AVERROR(EIO);
- return avio_skip(pb, length) < 0 ? AVERROR(EIO) : 0;
+ if (length) {
+ int64_t res2;
+ if (ffio_limit(pb, length) != length) {
+ // ffio_limit emits its own error message,
+ // so we don't have to.
+ return AVERROR(EIO);
+ }
+ if ((res2 = avio_skip(pb, length - 1)) >= 0) {
+ // avio_skip might take us past EOF. We check for this
+ // by skipping only length - 1 bytes, reading a byte and
+ // checking the error flags. This is done in order to check
+ // that the element has been properly skipped even when
+ // no filesize (that ffio_limit relies on) is available.
+ avio_r8(pb);
+ res = NEEDS_CHECKING;
+ } else
+ res = res2;
+ } else
+ res = 0;
+ }
+ if (res) {
+ if (res == NEEDS_CHECKING) {
+ if (pb->eof_reached) {
+ if (pb->error)
+ res = pb->error;
+ else
+ res = AVERROR_EOF;
+ } else
+ res = 0;
+ }
+
+ if (res == AVERROR_INVALIDDATA)
+ av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
+ else if (res == AVERROR(EIO))
+ av_log(matroska->ctx, AV_LOG_ERROR, "Read error\n");
+ else if (res == AVERROR_EOF) {
+ av_log(matroska->ctx, AV_LOG_ERROR, "File ended prematurely\n");
+ res = AVERROR(EIO);
+ }
}
- if (res == AVERROR_INVALIDDATA)
- av_log(matroska->ctx, AV_LOG_ERROR, "Invalid element\n");
- else if (res == AVERROR(EIO))
- av_log(matroska->ctx, AV_LOG_ERROR, "Read error\n");
return res;
}
@@ -1615,7 +1637,6 @@ static void matroska_convert_tags(AVFormatContext *s)
static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
uint64_t pos)
{
- uint32_t level_up = matroska->level_up;
uint32_t saved_id = matroska->current_id;
int64_t before_pos = avio_tell(matroska->ctx->pb);
MatroskaLevel level;
@@ -1651,7 +1672,6 @@ static int matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
}
/* seek back */
avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
- matroska->level_up = level_up;
matroska->current_id = saved_id;
return ret;
@@ -2618,8 +2638,6 @@ static int matroska_parse_tracks(AVFormatContext *s)
}
} else if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE) {
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
- if (st->codecpar->codec_id == AV_CODEC_ID_ASS)
- matroska->contains_ssa = 1;
}
}
@@ -2685,6 +2703,9 @@ static int matroska_read_header(AVFormatContext *s)
pos = avio_tell(matroska->ctx->pb);
res = ebml_parse(matroska, matroska_segment, matroska);
}
+ /* Set data_offset as it might be needed later by seek_frame_generic. */
+ if (matroska->current_id == MATROSKA_ID_CLUSTER)
+ s->internal->data_offset = avio_tell(matroska->ctx->pb) - 4;
matroska_execute_seekhead(matroska);
if (!matroska->time_scale)
@@ -2726,15 +2747,19 @@ static int matroska_read_header(AVFormatContext *s)
attachments[j].stream = st;
if (st->codecpar->codec_id != AV_CODEC_ID_NONE) {
+ AVPacket *pkt = &st->attached_pic;
+
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- av_init_packet(&st->attached_pic);
- if ((res = av_new_packet(&st->attached_pic, attachments[j].bin.size)) < 0)
- return res;
- memcpy(st->attached_pic.data, attachments[j].bin.data, attachments[j].bin.size);
- st->attached_pic.stream_index = st->index;
- st->attached_pic.flags |= AV_PKT_FLAG_KEY;
+ av_init_packet(pkt);
+ pkt->buf = av_buffer_ref(attachments[j].bin.buf);
+ if (!pkt->buf)
+ return AVERROR(ENOMEM);
+ pkt->data = attachments[j].bin.data;
+ pkt->size = attachments[j].bin.size;
+ pkt->stream_index = st->index;
+ pkt->flags |= AV_PKT_FLAG_KEY;
} else {
st->codecpar->codec_type = AVMEDIA_TYPE_ATTACHMENT;
if (ff_alloc_extradata(st->codecpar, attachments[j].bin.size))
@@ -2825,7 +2850,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
if (!type) {
*laces = 1;
- *lace_buf = av_mallocz(sizeof(int));
+ *lace_buf = av_malloc(sizeof(**lace_buf));
if (!*lace_buf)
return AVERROR(ENOMEM);
@@ -2837,7 +2862,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
*laces = *data + 1;
data += 1;
size -= 1;
- lace_size = av_mallocz(*laces * sizeof(int));
+ lace_size = av_malloc_array(*laces, sizeof(*lace_size));
if (!lace_size)
return AVERROR(ENOMEM);
@@ -2847,6 +2872,8 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
uint8_t temp;
uint32_t total = 0;
for (n = 0; res == 0 && n < *laces - 1; n++) {
+ lace_size[n] = 0;
+
while (1) {
if (size <= total) {
res = AVERROR_INVALIDDATA;
@@ -3366,7 +3393,6 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
int trust_default_duration = 1;
if ((n = matroska_ebmlnum_uint(matroska, data, size, &num)) < 0) {
- av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
return n;
}
data += n;
@@ -3375,7 +3401,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf
track = matroska_find_track_by_num(matroska, num);
if (!track || !track->stream) {
av_log(matroska->ctx, AV_LOG_INFO,
- "Invalid stream %"PRIu64" or size %u\n", num, size);
+ "Invalid stream %"PRIu64"\n", num);
return AVERROR_INVALIDDATA;
} else if (size <= 3)
return 0;
@@ -3491,89 +3517,50 @@ end:
return res;
}
-static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
+static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
{
- EbmlList *blocks_list;
- MatroskaBlock *blocks;
- int i, res;
+ MatroskaCluster *cluster = &matroska->current_cluster;
+ MatroskaBlock *block = &cluster->block;
+ int res;
res = ebml_parse(matroska,
- matroska_cluster_incremental_parsing,
- &matroska->current_cluster);
+ matroska_cluster_parsing,
+ cluster);
if (res == 1) {
/* New Cluster */
- if (matroska->current_cluster_pos)
+ if (cluster->pos)
ebml_level_end(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);
+ cluster->pos = avio_tell(matroska->ctx->pb);
/* sizeof the ID which was already read */
if (matroska->current_id)
- matroska->current_cluster_pos -= 4;
+ cluster->pos -= 4;
res = ebml_parse(matroska,
- matroska_clusters_incremental,
- &matroska->current_cluster);
+ matroska_clusters,
+ cluster);
/* Try parsing the block again. */
if (res == 1)
res = ebml_parse(matroska,
- matroska_cluster_incremental_parsing,
- &matroska->current_cluster);
+ matroska_cluster_parsing,
+ cluster);
}
- if (!res &&
- matroska->current_cluster_num_blocks <
- matroska->current_cluster.blocks.nb_elem) {
- blocks_list = &matroska->current_cluster.blocks;
- blocks = blocks_list->elem;
-
- matroska->current_cluster_num_blocks = blocks_list->nb_elem;
- 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 == INT64_MIN : -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.buf, blocks[i].bin.data,
- blocks[i].bin.size, blocks[i].bin.pos,
+ if (!res && block->bin.size > 0) {
+ int is_keyframe = block->non_simple ? block->reference == INT64_MIN : -1;
+ uint8_t* additional = block->additional.size > 0 ?
+ block->additional.data : NULL;
+
+ res = matroska_parse_block(matroska, block->bin.buf, block->bin.data,
+ block->bin.size, block->bin.pos,
matroska->current_cluster.timecode,
- blocks[i].duration, is_keyframe,
- additional, blocks[i].additional_id,
- blocks[i].additional.size,
- matroska->current_cluster_pos,
- blocks[i].discard_padding);
- }
+ block->duration, is_keyframe,
+ additional, block->additional_id,
+ block->additional.size,
+ cluster->pos,
+ block->discard_padding);
}
- return res;
-}
+ ebml_free(matroska_blockgroup, block);
+ memset(block, 0, sizeof(*block));
-static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
-{
- MatroskaCluster cluster = { 0 };
- EbmlList *blocks_list;
- MatroskaBlock *blocks;
- int i, res;
- int64_t pos;
-
- if (!matroska->contains_ssa)
- return matroska_parse_cluster_incremental(matroska);
- pos = avio_tell(matroska->ctx->pb);
- if (matroska->current_id)
- pos -= 4; /* sizeof the ID which was already read */
- res = ebml_parse(matroska, matroska_clusters, &cluster);
- blocks_list = &cluster.blocks;
- 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 == INT64_MIN : -1;
- res = matroska_parse_block(matroska, blocks[i].bin.buf, 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;
}
@@ -3599,7 +3586,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
MatroskaDemuxContext *matroska = s->priv_data;
MatroskaTrack *tracks = NULL;
AVStream *st = s->streams[stream_index];
- int i, index, index_min;
+ int i, index;
/* Parse the CUES now since we need the index data to seek. */
if (matroska->cues_parsing_deferred > 0) {
@@ -3626,7 +3613,6 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
if (index < 0 || (matroska->cues_parsing_deferred < 0 && index == st->nb_index_entries - 1))
goto err;
- index_min = index;
tracks = matroska->tracks.elem;
for (i = 0; i < matroska->tracks.nb_elem; i++) {
tracks[i].audio.pkt_cnt = 0;
@@ -3635,7 +3621,7 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
tracks[i].end_timecode = 0;
}
- avio_seek(s->pb, st->index_entries[index_min].pos, SEEK_SET);
+ avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
matroska->current_id = 0;
if (flags & AVSEEK_FLAG_ANY) {
st->skip_to_keyframe = 0;
@@ -3672,7 +3658,6 @@ static int matroska_read_close(AVFormatContext *s)
for (n = 0; n < matroska->tracks.nb_elem; n++)
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
av_freep(&tracks[n].audio.buf);
- ebml_free(matroska_cluster, &matroska->current_cluster);
ebml_free(matroska_segment, matroska);
return 0;
@@ -3730,15 +3715,17 @@ static int webm_clusters_start_with_keyframe(AVFormatContext *s)
cluster_pos = s->streams[0]->index_entries[index].pos;
before_pos = avio_tell(s->pb);
while (1) {
- int64_t cluster_id = 0, cluster_length = 0;
+ uint64_t cluster_id, cluster_length;
+ int read;
AVPacket *pkt;
avio_seek(s->pb, cluster_pos, SEEK_SET);
// read cluster id and length
- ebml_read_num(matroska, matroska->ctx->pb, 4, &cluster_id);
- ebml_read_length(matroska, matroska->ctx->pb, &cluster_length);
- if (cluster_id != 0xF43B675) { // done with all clusters
+ read = ebml_read_num(matroska, matroska->ctx->pb, 4, &cluster_id, 1);
+ if (read < 0 || cluster_id != 0xF43B675) // done with all clusters
+ break;
+ read = ebml_read_length(matroska, matroska->ctx->pb, &cluster_length);
+ if (read < 0)
break;
- }
avio_seek(s->pb, cluster_pos, SEEK_SET);
matroska->current_id = 0;
matroska_clear_queue(matroska);
@@ -3747,7 +3734,8 @@ static int webm_clusters_start_with_keyframe(AVFormatContext *s)
break;
}
pkt = &matroska->queue->pkt;
- cluster_pos += cluster_length + 12; // 12 is the offset of the cluster id and length.
+ // 4 + read is the length of the cluster id and the cluster length field.
+ cluster_pos += 4 + read + cluster_length;
if (!(pkt->flags & AV_PKT_FLAG_KEY)) {
rv = 0;
break;
@@ -3946,12 +3934,17 @@ static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
cues_start = seekhead[i].pos + matroska->segment_start;
if (avio_seek(matroska->ctx->pb, cues_start, SEEK_SET) == cues_start) {
// cues_end is computed as cues_start + cues_length + length of the
- // Cues element ID + EBML length of the Cues element. cues_end is
- // inclusive and the above sum is reduced by 1.
- uint64_t cues_length = 0, cues_id = 0, bytes_read = 0;
- bytes_read += ebml_read_num(matroska, matroska->ctx->pb, 4, &cues_id);
- bytes_read += ebml_read_length(matroska, matroska->ctx->pb, &cues_length);
- cues_end = cues_start + cues_length + bytes_read - 1;
+ // Cues element ID (i.e. 4) + EBML length of the Cues element.
+ // cues_end is inclusive and the above sum is reduced by 1.
+ uint64_t cues_length, cues_id;
+ int bytes_read;
+ bytes_read = ebml_read_num (matroska, matroska->ctx->pb, 4, &cues_id, 1);
+ if (bytes_read < 0 || cues_id != (MATROSKA_ID_CUES & 0xfffffff))
+ return bytes_read < 0 ? bytes_read : AVERROR_INVALIDDATA;
+ bytes_read = ebml_read_length(matroska, matroska->ctx->pb, &cues_length);
+ if (bytes_read < 0)
+ return bytes_read;
+ cues_end = cues_start + 4 + bytes_read + cues_length - 1;
}
avio_seek(matroska->ctx->pb, before_pos, SEEK_SET);
if (cues_start == -1 || cues_end == -1) return -1;
diff --git a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
index 1c98c0dcebb..cef504fa057 100644
--- a/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/matroskaenc.c
@@ -58,12 +58,12 @@
#include "libavcodec/internal.h"
typedef struct ebml_master {
- int64_t pos; ///< absolute offset in the file where the master's elements start
+ int64_t pos; ///< absolute offset in the containing AVIOContext where the master's elements start
int sizebytes; ///< how many bytes were reserved for the size
} ebml_master;
typedef struct mkv_seekhead_entry {
- unsigned int elementid;
+ uint32_t elementid;
uint64_t segmentpos;
} mkv_seekhead_entry;
@@ -118,23 +118,22 @@ typedef struct mkv_attachments {
#define MAX_TRACKS 126
typedef struct MatroskaMuxContext {
- const AVClass *class;
+ const AVClass *class;
int mode;
- AVIOContext *dyn_bc;
AVIOContext *tags_bc;
- ebml_master tags;
+ int64_t tags_pos;
AVIOContext *info_bc;
- ebml_master info;
+ int64_t info_pos;
AVIOContext *tracks_bc;
- ebml_master tracks_master;
+ int64_t tracks_pos;
ebml_master segment;
int64_t segment_offset;
- ebml_master cluster;
+ AVIOContext *cluster_bc;
int64_t cluster_pos; ///< file offset of the current cluster
int64_t cluster_pts;
int64_t duration_offset;
int64_t duration;
- mkv_seekhead *main_seekhead;
+ mkv_seekhead *seekhead;
mkv_cues *cues;
mkv_track *tracks;
mkv_attachments *attachments;
@@ -158,33 +157,36 @@ typedef struct MatroskaMuxContext {
int64_t last_track_timestamp[MAX_TRACKS];
- int64_t* stream_durations;
- int64_t* stream_duration_offsets;
+ int64_t *stream_durations;
+ int64_t *stream_duration_offsets;
int allow_raw_vfw;
} MatroskaMuxContext;
+/** 2 bytes * 7 for EBML IDs, 7 1-byte EBML lengths, 6 1-byte uint,
+ * 8 byte for "matroska" doctype string */
+#define MAX_EBML_HEADER_SIZE 35
/** 2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit
* offset, 4 bytes for target EBML ID */
#define MAX_SEEKENTRY_SIZE 21
-/** per-cuepoint-track - 5 1-byte EBML IDs, 5 1-byte EBML sizes, 4
- * 8-byte uint max */
-#define MAX_CUETRACKPOS_SIZE 42
+/** per-cuepoint-track - 5 1-byte EBML IDs, 5 1-byte EBML sizes, 3 8-byte uint max
+ * and one 1-byte uint for the track number (this assumes MAX_TRACKS to be <= 255) */
+#define MAX_CUETRACKPOS_SIZE 35
-/** per-cuepoint - 2 1-byte EBML IDs, 2 1-byte EBML sizes, 8-byte uint max */
-#define MAX_CUEPOINT_SIZE(num_tracks) 12 + MAX_CUETRACKPOS_SIZE * num_tracks
+/** per-cuepoint - 1 1-byte EBML ID, 1 1-byte EBML size, 8-byte uint max */
+#define MAX_CUEPOINT_CONTENT_SIZE(num_tracks) 10 + MAX_CUETRACKPOS_SIZE * num_tracks
/** Seek preroll value for opus */
#define OPUS_SEEK_PREROLL 80000000
-static int ebml_id_size(unsigned int id)
+static int ebml_id_size(uint32_t id)
{
return (av_log2(id + 1) - 1) / 7 + 1;
}
-static void put_ebml_id(AVIOContext *pb, unsigned int id)
+static void put_ebml_id(AVIOContext *pb, uint32_t id)
{
int i = ebml_id_size(id);
while (i--)
@@ -239,7 +241,7 @@ static void put_ebml_num(AVIOContext *pb, uint64_t num, int bytes)
avio_w8(pb, (uint8_t)(num >> i * 8));
}
-static void put_ebml_uint(AVIOContext *pb, unsigned int elementid, uint64_t val)
+static void put_ebml_uint(AVIOContext *pb, uint32_t elementid, uint64_t val)
{
int i, bytes = 1;
uint64_t tmp = val;
@@ -252,7 +254,7 @@ static void put_ebml_uint(AVIOContext *pb, unsigned int elementid, uint64_t val)
avio_w8(pb, (uint8_t)(val >> i * 8));
}
-static void put_ebml_sint(AVIOContext *pb, unsigned int elementid, int64_t val)
+static void put_ebml_sint(AVIOContext *pb, uint32_t elementid, int64_t val)
{
int i, bytes = 1;
uint64_t tmp = 2*(val < 0 ? val^-1 : val);
@@ -265,14 +267,14 @@ static void put_ebml_sint(AVIOContext *pb, unsigned int elementid, int64_t val)
avio_w8(pb, (uint8_t)(val >> i * 8));
}
-static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
+static void put_ebml_float(AVIOContext *pb, uint32_t elementid, double val)
{
put_ebml_id(pb, elementid);
put_ebml_num(pb, 8, 0);
avio_wb64(pb, av_double2int(val));
}
-static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
+static void put_ebml_binary(AVIOContext *pb, uint32_t elementid,
const void *buf, int size)
{
put_ebml_id(pb, elementid);
@@ -280,7 +282,7 @@ static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
avio_write(pb, buf, size);
}
-static void put_ebml_string(AVIOContext *pb, unsigned int elementid,
+static void put_ebml_string(AVIOContext *pb, uint32_t elementid,
const char *str)
{
put_ebml_binary(pb, elementid, str, strlen(str));
@@ -309,13 +311,14 @@ static void put_ebml_void(AVIOContext *pb, uint64_t size)
ffio_fill(pb, 0, currentpos + size - avio_tell(pb));
}
-static ebml_master start_ebml_master(AVIOContext *pb, unsigned int elementid,
+static ebml_master start_ebml_master(AVIOContext *pb, uint32_t elementid,
uint64_t expectedsize)
{
int bytes = expectedsize ? ebml_num_size(expectedsize) : 8;
+
put_ebml_id(pb, elementid);
put_ebml_size_unknown(pb, bytes);
- return (ebml_master) {avio_tell(pb), bytes };
+ return (ebml_master) { avio_tell(pb), bytes };
}
static void end_ebml_master(AVIOContext *pb, ebml_master master)
@@ -329,61 +332,51 @@ static void end_ebml_master(AVIOContext *pb, ebml_master master)
}
static int start_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv,
- ebml_master *master, unsigned int elementid, uint64_t expectedsize)
+ uint32_t elementid)
{
int ret;
if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)
return ret;
- if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
- *master = start_ebml_master(pb, elementid, expectedsize);
- if (mkv->write_crc && mkv->mode != MODE_WEBM)
- put_ebml_void(*dyn_cp, 6); /* Reserve space for CRC32 so position/size calculations using avio_tell() take it into account */
- } else
- *master = start_ebml_master(*dyn_cp, elementid, expectedsize);
+ put_ebml_id(pb, elementid);
+ if (mkv->write_crc)
+ put_ebml_void(*dyn_cp, 6); /* Reserve space for CRC32 so position/size calculations using avio_tell() take it into account */
return 0;
}
-static void end_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv,
- ebml_master master)
+static void end_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv)
{
uint8_t *buf, crc[4];
int size, skip = 0;
- if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
- size = avio_close_dyn_buf(*dyn_cp, &buf);
- if (mkv->write_crc && mkv->mode != MODE_WEBM) {
- skip = 6; /* Skip reserved 6-byte long void element from the dynamic buffer. */
- AV_WL32(crc, av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), UINT32_MAX, buf + skip, size - skip) ^ UINT32_MAX);
- put_ebml_binary(pb, EBML_ID_CRC32, crc, sizeof(crc));
- }
- avio_write(pb, buf + skip, size - skip);
- end_ebml_master(pb, master);
- } else {
- end_ebml_master(*dyn_cp, master);
- size = avio_close_dyn_buf(*dyn_cp, &buf);
- avio_write(pb, buf, size);
+ size = avio_close_dyn_buf(*dyn_cp, &buf);
+ put_ebml_num(pb, size, 0);
+ if (mkv->write_crc) {
+ skip = 6; /* Skip reserved 6-byte long void element from the dynamic buffer. */
+ AV_WL32(crc, av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), UINT32_MAX, buf + skip, size - skip) ^ UINT32_MAX);
+ put_ebml_binary(pb, EBML_ID_CRC32, crc, sizeof(crc));
}
+ avio_write(pb, buf + skip, size - skip);
+
av_free(buf);
*dyn_cp = NULL;
}
/**
-* Complete ebml master whithout destroying the buffer, allowing for later updates
+* Complete ebml master without destroying the buffer, allowing for later updates
*/
static void end_ebml_master_crc32_preliminary(AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv,
- ebml_master master)
+ int64_t *pos)
{
- if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
+ uint8_t *buf;
+ int size = avio_get_dyn_buf(*dyn_cp, &buf);
- uint8_t *buf;
- int size = avio_get_dyn_buf(*dyn_cp, &buf);
+ *pos = avio_tell(pb);
- avio_write(pb, buf, size);
- end_ebml_master(pb, master);
- }
+ put_ebml_num(pb, size, 0);
+ avio_write(pb, buf, size);
}
static void put_xiph_size(AVIOContext *pb, int size)
@@ -397,8 +390,8 @@ static void put_xiph_size(AVIOContext *pb, int size)
*/
static void mkv_free(MatroskaMuxContext *mkv) {
uint8_t* buf;
- if (mkv->dyn_bc) {
- avio_close_dyn_buf(mkv->dyn_bc, &buf);
+ if (mkv->cluster_bc) {
+ avio_close_dyn_buf(mkv->cluster_bc, &buf);
av_free(buf);
}
if (mkv->info_bc) {
@@ -413,9 +406,9 @@ static void mkv_free(MatroskaMuxContext *mkv) {
avio_close_dyn_buf(mkv->tags_bc, &buf);
av_free(buf);
}
- if (mkv->main_seekhead) {
- av_freep(&mkv->main_seekhead->entries);
- av_freep(&mkv->main_seekhead);
+ if (mkv->seekhead) {
+ av_freep(&mkv->seekhead->entries);
+ av_freep(&mkv->seekhead);
}
if (mkv->cues) {
av_freep(&mkv->cues->entries);
@@ -462,7 +455,7 @@ static mkv_seekhead *mkv_start_seekhead(AVIOContext *pb, int64_t segment_offset,
return new_seekhead;
}
-static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
+static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, uint32_t elementid, uint64_t filepos)
{
mkv_seekhead_entry *entries = seekhead->entries;
@@ -493,8 +486,8 @@ static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid
static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv)
{
AVIOContext *dyn_cp;
- mkv_seekhead *seekhead = mkv->main_seekhead;
- ebml_master metaseek, seekentry;
+ mkv_seekhead *seekhead = mkv->seekhead;
+ ebml_master seekentry;
int64_t currentpos;
int i;
@@ -507,8 +500,7 @@ static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv)
}
}
- if (start_ebml_master_crc32(pb, &dyn_cp, mkv, &metaseek, MATROSKA_ID_SEEKHEAD,
- seekhead->reserved_size) < 0) {
+ if (start_ebml_master_crc32(pb, &dyn_cp, mkv, MATROSKA_ID_SEEKHEAD) < 0) {
currentpos = -1;
goto fail;
}
@@ -525,7 +517,7 @@ static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv)
put_ebml_uint(dyn_cp, MATROSKA_ID_SEEKPOSITION, entry->segmentpos);
end_ebml_master(dyn_cp, seekentry);
}
- end_ebml_master_crc32(pb, &dyn_cp, mkv, metaseek);
+ end_ebml_master_crc32(pb, &dyn_cp, mkv);
if (seekhead->reserved_size > 0) {
uint64_t remaining = seekhead->filepos + seekhead->reserved_size - avio_tell(pb);
@@ -535,8 +527,8 @@ static int64_t mkv_write_seekhead(AVIOContext *pb, MatroskaMuxContext *mkv)
currentpos = seekhead->filepos;
}
fail:
- av_freep(&mkv->main_seekhead->entries);
- av_freep(&mkv->main_seekhead);
+ av_freep(&mkv->seekhead->entries);
+ av_freep(&mkv->seekhead);
return currentpos;
}
@@ -578,12 +570,11 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *dyn_cp, *pb = s->pb;
- ebml_master cues_element;
int64_t currentpos;
int i, j, ret;
currentpos = avio_tell(pb);
- ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, &cues_element, MATROSKA_ID_CUES, 0);
+ ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, MATROSKA_ID_CUES);
if (ret < 0)
return ret;
@@ -605,7 +596,7 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
ctp_nb ++;
}
- cuepoint = start_ebml_master(dyn_cp, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_SIZE(ctp_nb));
+ cuepoint = start_ebml_master(dyn_cp, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_CONTENT_SIZE(ctp_nb));
put_ebml_uint(dyn_cp, MATROSKA_ID_CUETIME, pts);
// put all the entries from different tracks that have the exact same
@@ -629,7 +620,7 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
i += j - 1;
end_ebml_master(dyn_cp, cuepoint);
}
- end_ebml_master_crc32(pb, &dyn_cp, mkv, cues_element);
+ end_ebml_master_crc32(pb, &dyn_cp, mkv);
return currentpos;
}
@@ -1455,11 +1446,11 @@ static int mkv_write_tracks(AVFormatContext *s)
AVIOContext *pb = s->pb;
int i, ret, default_stream_exists = 0;
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_TRACKS, avio_tell(pb));
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_TRACKS, avio_tell(pb));
if (ret < 0)
return ret;
- ret = start_ebml_master_crc32(pb, &mkv->tracks_bc, mkv, &mkv->tracks_master, MATROSKA_ID_TRACKS, 0);
+ ret = start_ebml_master_crc32(pb, &mkv->tracks_bc, mkv, MATROSKA_ID_TRACKS);
if (ret < 0)
return ret;
@@ -1474,9 +1465,9 @@ static int mkv_write_tracks(AVFormatContext *s)
}
if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
- end_ebml_master_crc32_preliminary(pb, &mkv->tracks_bc, mkv, mkv->tracks_master);
+ end_ebml_master_crc32_preliminary(pb, &mkv->tracks_bc, mkv, &mkv->tracks_pos);
else
- end_ebml_master_crc32(pb, &mkv->tracks_bc, mkv, mkv->tracks_master);
+ end_ebml_master_crc32(pb, &mkv->tracks_bc, mkv);
return 0;
}
@@ -1485,17 +1476,17 @@ static int mkv_write_chapters(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *dyn_cp, *pb = s->pb;
- ebml_master chapters, editionentry;
+ ebml_master editionentry;
AVRational scale = {1, 1E9};
int i, ret;
if (!s->nb_chapters || mkv->wrote_chapters)
return 0;
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CHAPTERS, avio_tell(pb));
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_CHAPTERS, avio_tell(pb));
if (ret < 0) return ret;
- ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, &chapters, MATROSKA_ID_CHAPTERS, 0);
+ ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, MATROSKA_ID_CHAPTERS);
if (ret < 0) return ret;
editionentry = start_ebml_master(dyn_cp, MATROSKA_ID_EDITIONENTRY, 0);
@@ -1533,7 +1524,7 @@ static int mkv_write_chapters(AVFormatContext *s)
end_ebml_master(dyn_cp, chapteratom);
}
end_ebml_master(dyn_cp, editionentry);
- end_ebml_master_crc32(pb, &dyn_cp, mkv, chapters);
+ end_ebml_master_crc32(pb, &dyn_cp, mkv);
mkv->wrote_chapters = 1;
return 0;
@@ -1573,24 +1564,23 @@ static int mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
return 0;
}
-static int mkv_write_tag_targets(AVFormatContext *s,
- unsigned int elementid, unsigned int uid,
- ebml_master *tags, ebml_master* tag)
+static int mkv_write_tag_targets(AVFormatContext *s, uint32_t elementid,
+ unsigned int uid, ebml_master *tag)
{
AVIOContext *pb;
MatroskaMuxContext *mkv = s->priv_data;
ebml_master targets;
int ret;
- if (!tags->pos) {
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_TAGS, avio_tell(s->pb));
+ if (!mkv->tags_bc) {
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_TAGS, avio_tell(s->pb));
if (ret < 0) return ret;
- start_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, tags, MATROSKA_ID_TAGS, 0);
+ start_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, MATROSKA_ID_TAGS);
}
pb = mkv->tags_bc;
- *tag = start_ebml_master(pb, MATROSKA_ID_TAG, 0);
+ *tag = start_ebml_master(pb, MATROSKA_ID_TAG, 0);
targets = start_ebml_master(pb, MATROSKA_ID_TAGTARGETS, 0);
if (elementid)
put_ebml_uint(pb, elementid, uid);
@@ -1598,7 +1588,7 @@ static int mkv_write_tag_targets(AVFormatContext *s,
return 0;
}
-static int mkv_check_tag_name(const char *name, unsigned int elementid)
+static int mkv_check_tag_name(const char *name, uint32_t elementid)
{
return av_strcasecmp(name, "title") &&
av_strcasecmp(name, "stereo_mode") &&
@@ -1612,15 +1602,15 @@ static int mkv_check_tag_name(const char *name, unsigned int elementid)
av_strcasecmp(name, "mimetype")));
}
-static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid,
- unsigned int uid, ebml_master *tags)
+static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, uint32_t elementid,
+ unsigned int uid)
{
MatroskaMuxContext *mkv = s->priv_data;
ebml_master tag;
int ret;
AVDictionaryEntry *t = NULL;
- ret = mkv_write_tag_targets(s, elementid, uid, tags, &tag);
+ ret = mkv_write_tag_targets(s, elementid, uid, &tag);
if (ret < 0)
return ret;
@@ -1636,7 +1626,7 @@ static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme
return 0;
}
-static int mkv_check_tag(AVDictionary *m, unsigned int elementid)
+static int mkv_check_tag(AVDictionary *m, uint32_t elementid)
{
AVDictionaryEntry *t = NULL;
@@ -1655,7 +1645,7 @@ static int mkv_write_tags(AVFormatContext *s)
ff_metadata_conv_ctx(s, ff_mkv_metadata_conv, NULL);
if (mkv_check_tag(s->metadata, 0)) {
- ret = mkv_write_tag(s, s->metadata, 0, 0, &mkv->tags);
+ ret = mkv_write_tag(s, s->metadata, 0, 0);
if (ret < 0) return ret;
}
@@ -1668,7 +1658,7 @@ static int mkv_write_tags(AVFormatContext *s)
if (!mkv_check_tag(st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID))
continue;
- ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &mkv->tags);
+ ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1);
if (ret < 0) return ret;
}
@@ -1682,7 +1672,7 @@ static int mkv_write_tags(AVFormatContext *s)
if (st->codecpar->codec_type == AVMEDIA_TYPE_ATTACHMENT)
continue;
- mkv_write_tag_targets(s, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &mkv->tags, &tag_target);
+ mkv_write_tag_targets(s, MATROSKA_ID_TAGTARGETS_TRACKUID, i + 1, &tag_target);
pb = mkv->tags_bc;
tag = start_ebml_master(pb, MATROSKA_ID_SIMPLETAG, 0);
@@ -1704,7 +1694,7 @@ static int mkv_write_tags(AVFormatContext *s)
if (!mkv_check_tag(ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID))
continue;
- ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset, &mkv->tags);
+ ret = mkv_write_tag(s, ch->metadata, MATROSKA_ID_TAGTARGETS_CHAPTERUID, ch->id + mkv->chapter_id_offset);
if (ret < 0)
return ret;
}
@@ -1718,17 +1708,17 @@ static int mkv_write_tags(AVFormatContext *s)
if (!mkv_check_tag(st->metadata, MATROSKA_ID_TAGTARGETS_ATTACHUID))
continue;
- ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_ATTACHUID, attachment->fileuid, &mkv->tags);
+ ret = mkv_write_tag(s, st->metadata, MATROSKA_ID_TAGTARGETS_ATTACHUID, attachment->fileuid);
if (ret < 0)
return ret;
}
}
- if (mkv->tags.pos) {
+ if (mkv->tags_bc) {
if ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
- end_ebml_master_crc32_preliminary(s->pb, &mkv->tags_bc, mkv, mkv->tags);
+ end_ebml_master_crc32_preliminary(s->pb, &mkv->tags_bc, mkv, &mkv->tags_pos);
else
- end_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv, mkv->tags);
+ end_ebml_master_crc32(s->pb, &mkv->tags_bc, mkv);
}
return 0;
}
@@ -1737,7 +1727,6 @@ static int mkv_write_attachments(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *dyn_cp, *pb = s->pb;
- ebml_master attachments;
AVLFG c;
int i, ret;
@@ -1750,10 +1739,10 @@ static int mkv_write_attachments(AVFormatContext *s)
av_lfg_init(&c, av_get_random_seed());
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_ATTACHMENTS, avio_tell(pb));
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_ATTACHMENTS, avio_tell(pb));
if (ret < 0) return ret;
- ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, &attachments, MATROSKA_ID_ATTACHMENTS, 0);
+ ret = start_ebml_master_crc32(pb, &dyn_cp, mkv, MATROSKA_ID_ATTACHMENTS);
if (ret < 0) return ret;
for (i = 0; i < s->nb_streams; i++) {
@@ -1826,7 +1815,7 @@ static int mkv_write_attachments(AVFormatContext *s)
mkv->attachments->entries[mkv->attachments->num_entries].stream_idx = i;
mkv->attachments->entries[mkv->attachments->num_entries++].fileuid = fileuid;
}
- end_ebml_master_crc32(pb, &dyn_cp, mkv, attachments);
+ end_ebml_master_crc32(pb, &dyn_cp, mkv);
return 0;
}
@@ -1864,9 +1853,10 @@ static int mkv_write_header(AVFormatContext *s)
int ret, i, version = 2;
int64_t creation_time;
- if (!strcmp(s->oformat->name, "webm"))
- mkv->mode = MODE_WEBM;
- else
+ if (!strcmp(s->oformat->name, "webm")) {
+ mkv->mode = MODE_WEBM;
+ mkv->write_crc = 0;
+ } else
mkv->mode = MODE_MATROSKAv2;
if (mkv->mode != MODE_WEBM ||
@@ -1886,34 +1876,32 @@ static int mkv_write_header(AVFormatContext *s)
ret = AVERROR(ENOMEM);
goto fail;
}
- ebml_header = start_ebml_master(pb, EBML_ID_HEADER, 0);
- put_ebml_uint (pb, EBML_ID_EBMLVERSION , 1);
- put_ebml_uint (pb, EBML_ID_EBMLREADVERSION , 1);
- 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 , version);
- put_ebml_uint (pb, EBML_ID_DOCTYPEREADVERSION , 2);
+ ebml_header = start_ebml_master(pb, EBML_ID_HEADER, MAX_EBML_HEADER_SIZE);
+ put_ebml_uint (pb, EBML_ID_EBMLVERSION , 1);
+ put_ebml_uint (pb, EBML_ID_EBMLREADVERSION , 1);
+ 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 , version);
+ put_ebml_uint (pb, EBML_ID_DOCTYPEREADVERSION, 2);
end_ebml_master(pb, ebml_header);
mkv->segment = start_ebml_master(pb, MATROSKA_ID_SEGMENT, 0);
mkv->segment_offset = avio_tell(pb);
- // we write 2 seek heads - one at the end of the file to point to each
- // cluster, and one at the beginning to point to all other level one
- // elements (including the seek head at the end of the file), which
- // isn't more than 10 elements if we only write one of each other
- // currently defined level 1 element
- mkv->main_seekhead = mkv_start_seekhead(pb, mkv->segment_offset, 10);
- if (!mkv->main_seekhead) {
+ // we write a seek head at the beginning to point to all other level
+ // one elements, which aren't more than 10 elements as we write only one
+ // of every other currently defined level 1 element
+ mkv->seekhead = mkv_start_seekhead(pb, mkv->segment_offset, 10);
+ if (!mkv->seekhead) {
ret = AVERROR(ENOMEM);
goto fail;
}
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_INFO, avio_tell(pb));
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_INFO, avio_tell(pb));
if (ret < 0) goto fail;
- ret = start_ebml_master_crc32(pb, &mkv->info_bc, mkv, &mkv->info, MATROSKA_ID_INFO, 0);
+ ret = start_ebml_master_crc32(pb, &mkv->info_bc, mkv, MATROSKA_ID_INFO);
if (ret < 0)
return ret;
pb = mkv->info_bc;
@@ -1972,13 +1960,13 @@ static int mkv_write_header(AVFormatContext *s)
}
}
if ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live)
- end_ebml_master_crc32_preliminary(s->pb, &mkv->info_bc, mkv, mkv->info);
+ end_ebml_master_crc32_preliminary(s->pb, &mkv->info_bc, mkv, &mkv->info_pos);
else
- end_ebml_master_crc32(s->pb, &mkv->info_bc, mkv, mkv->info);
+ end_ebml_master_crc32(s->pb, &mkv->info_bc, mkv);
pb = s->pb;
// initialize stream_duration fields
- mkv->stream_durations = av_mallocz(s->nb_streams * sizeof(int64_t));
+ mkv->stream_durations = av_mallocz(s->nb_streams * sizeof(int64_t));
mkv->stream_duration_offsets = av_mallocz(s->nb_streams * sizeof(int64_t));
if (!mkv->stream_durations || !mkv->stream_duration_offsets) {
ret = AVERROR(ENOMEM);
@@ -2059,9 +2047,7 @@ static int mkv_blockgroup_size(int pkt_size)
int size = pkt_size + 4;
size += ebml_num_size(size);
size += 2; // EBML ID for block and block duration
- size += 8; // max size of block duration
- size += ebml_num_size(size);
- size += 1; // blockgroup EBML ID
+ size += 9; // max size of block duration incl. length field
return size;
}
@@ -2119,7 +2105,7 @@ fail:
}
static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
- unsigned int blockid, AVPacket *pkt, int keyframe)
+ uint32_t blockid, AVPacket *pkt, int keyframe)
{
MatroskaMuxContext *mkv = s->priv_data;
AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
@@ -2133,10 +2119,14 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
ts += mkv->tracks[pkt->stream_index].ts_offset;
- av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, "
- "pts %" PRId64 ", dts %" PRId64 ", duration %" PRId64 ", keyframe %d\n",
- avio_tell(pb), pkt->size, pkt->pts, pkt->dts, pkt->duration,
- keyframe != 0);
+ /* The following string is identical to the one in mkv_write_vtt_blocks
+ * so that only one copy needs to exist in binaries. */
+ av_log(s, AV_LOG_DEBUG,
+ "Writing block of size %d with pts %" PRId64 ", dts %" PRId64 ", "
+ "duration %" PRId64 " at relative offset %" PRId64 " in cluster "
+ "at offset %" PRId64 ". TrackNumber %d, keyframe %d\n",
+ pkt->size, pkt->pts, pkt->dts, pkt->duration, avio_tell(pb),
+ mkv->cluster_pos, track_number, keyframe != 0);
if (par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 0 &&
(AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1))
ff_avc_parse_nal_units_buf(pkt->data, &data, &size);
@@ -2240,9 +2230,14 @@ static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *p
size = id_size + 1 + settings_size + 1 + pkt->size;
- av_log(s, AV_LOG_DEBUG, "Writing block at offset %" PRIu64 ", size %d, "
- "pts %" PRId64 ", dts %" PRId64 ", duration %" PRId64 ", flags %d\n",
- avio_tell(pb), size, pkt->pts, pkt->dts, pkt->duration, flags);
+ /* The following string is identical to the one in mkv_write_block so that
+ * only one copy needs to exist in binaries. */
+ av_log(s, AV_LOG_DEBUG,
+ "Writing block of size %d with pts %" PRId64 ", dts %" PRId64 ", "
+ "duration %" PRId64 " at relative offset %" PRId64 " in cluster "
+ "at offset %" PRId64 ". TrackNumber %d, keyframe %d\n",
+ size, pkt->pts, pkt->dts, pkt->duration, avio_tell(pb),
+ mkv->cluster_pos, pkt->stream_index + 1, 1);
blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(size));
@@ -2263,17 +2258,12 @@ static void mkv_start_new_cluster(AVFormatContext *s, AVPacket *pkt)
{
MatroskaMuxContext *mkv = s->priv_data;
- end_ebml_master_crc32(s->pb, &mkv->dyn_bc, mkv, mkv->cluster);
+ end_ebml_master_crc32(s->pb, &mkv->cluster_bc, mkv);
mkv->cluster_pos = -1;
- if (s->pb->seekable & AVIO_SEEKABLE_NORMAL)
- av_log(s, AV_LOG_DEBUG,
- "Starting new cluster at offset %" PRIu64 " bytes, "
- "pts %" PRIu64 "dts %" PRIu64 "\n",
- avio_tell(s->pb), pkt->pts, pkt->dts);
- else
- av_log(s, AV_LOG_DEBUG, "Starting new cluster, "
- "pts %" PRIu64 "dts %" PRIu64 "\n",
- pkt->pts, pkt->dts);
+ av_log(s, AV_LOG_DEBUG,
+ "Starting new cluster at offset %" PRIu64 " bytes, "
+ "pts %" PRIu64 ", dts %" PRIu64 "\n",
+ avio_tell(s->pb), pkt->pts, pkt->dts);
avio_flush(s->pb);
}
@@ -2404,7 +2394,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
ts += mkv->tracks[pkt->stream_index].ts_offset;
if (mkv->cluster_pos != -1) {
- int64_t cluster_time = ts - mkv->cluster_pts + mkv->tracks[pkt->stream_index].ts_offset;
+ int64_t cluster_time = ts - mkv->cluster_pts;
if ((int16_t)cluster_time != cluster_time) {
av_log(s, AV_LOG_WARNING, "Starting new cluster due to timestamp\n");
mkv_start_new_cluster(s, pkt);
@@ -2413,13 +2403,13 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
if (mkv->cluster_pos == -1) {
mkv->cluster_pos = avio_tell(s->pb);
- ret = start_ebml_master_crc32(s->pb, &mkv->dyn_bc, mkv, &mkv->cluster, MATROSKA_ID_CLUSTER, 0);
+ ret = start_ebml_master_crc32(s->pb, &mkv->cluster_bc, mkv, MATROSKA_ID_CLUSTER);
if (ret < 0)
return ret;
- put_ebml_uint(mkv->dyn_bc, MATROSKA_ID_CLUSTERTIMECODE, FFMAX(0, ts));
+ put_ebml_uint(mkv->cluster_bc, MATROSKA_ID_CLUSTERTIMECODE, FFMAX(0, ts));
mkv->cluster_pts = FFMAX(0, ts);
}
- pb = mkv->dyn_bc;
+ pb = mkv->cluster_bc;
relative_packet_pos = avio_tell(pb);
@@ -2489,7 +2479,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
// start a new cluster every 5 MB or 5 sec, or 32k / 1 sec for streaming or
// after 4k and on a keyframe
- cluster_size = avio_tell(mkv->dyn_bc);
+ cluster_size = avio_tell(mkv->cluster_bc);
if (mkv->is_dash && codec_type == AVMEDIA_TYPE_VIDEO) {
// WebM DASH specification states that the first block of every cluster
@@ -2549,14 +2539,11 @@ static int mkv_write_flush_packet(AVFormatContext *s, AVPacket *pkt)
if (!pkt) {
if (mkv->cluster_pos != -1) {
- end_ebml_master_crc32(s->pb, &mkv->dyn_bc, mkv, mkv->cluster);
+ end_ebml_master_crc32(s->pb, &mkv->cluster_bc, mkv);
mkv->cluster_pos = -1;
- if (s->pb->seekable & AVIO_SEEKABLE_NORMAL)
- av_log(s, AV_LOG_DEBUG,
- "Flushing cluster at offset %" PRIu64 " bytes\n",
- avio_tell(s->pb));
- else
- av_log(s, AV_LOG_DEBUG, "Flushing cluster\n");
+ av_log(s, AV_LOG_DEBUG,
+ "Flushing cluster at offset %" PRIu64 " bytes\n",
+ avio_tell(s->pb));
avio_flush(s->pb);
}
return 1;
@@ -2582,8 +2569,8 @@ static int mkv_write_trailer(AVFormatContext *s)
}
}
- if (mkv->dyn_bc) {
- end_ebml_master_crc32(pb, &mkv->dyn_bc, mkv, mkv->cluster);
+ if (mkv->cluster_bc) {
+ end_ebml_master_crc32(pb, &mkv->cluster_bc, mkv);
}
ret = mkv_write_chapters(s);
@@ -2618,7 +2605,7 @@ static int mkv_write_trailer(AVFormatContext *s)
cuespos = mkv_write_cues(s, mkv->cues, mkv->tracks, s->nb_streams);
}
- ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES,
+ ret = mkv_add_seekhead_entry(mkv->seekhead, MATROSKA_ID_CUES,
cuespos);
if (ret < 0)
return ret;
@@ -2631,12 +2618,12 @@ static int mkv_write_trailer(AVFormatContext *s)
currentpos = avio_tell(pb);
avio_seek(mkv->info_bc, mkv->duration_offset, SEEK_SET);
put_ebml_float(mkv->info_bc, MATROSKA_ID_DURATION, mkv->duration);
- avio_seek(pb, mkv->info.pos, SEEK_SET);
- end_ebml_master_crc32(pb, &mkv->info_bc, mkv, mkv->info);
+ avio_seek(pb, mkv->info_pos, SEEK_SET);
+ end_ebml_master_crc32(pb, &mkv->info_bc, mkv);
// write tracks master
- avio_seek(pb, mkv->tracks_master.pos, SEEK_SET);
- end_ebml_master_crc32(pb, &mkv->tracks_bc, mkv, mkv->tracks_master);
+ avio_seek(pb, mkv->tracks_pos, SEEK_SET);
+ end_ebml_master_crc32(pb, &mkv->tracks_bc, mkv);
// update stream durations
if (!mkv->is_live && mkv->stream_durations) {
@@ -2663,9 +2650,9 @@ static int mkv_write_trailer(AVFormatContext *s)
}
avio_seek(mkv->tags_bc, curr, SEEK_SET);
}
- if (mkv->tags.pos && !mkv->is_live) {
- avio_seek(pb, mkv->tags.pos, SEEK_SET);
- end_ebml_master_crc32(pb, &mkv->tags_bc, mkv, mkv->tags);
+ if (mkv->tags_bc && !mkv->is_live) {
+ avio_seek(pb, mkv->tags_pos, SEEK_SET);
+ end_ebml_master_crc32(pb, &mkv->tags_bc, mkv);
}
avio_seek(pb, currentpos, SEEK_SET);
diff --git a/chromium/third_party/ffmpeg/libavformat/microdvddec.c b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
index ef6bcfbc734..ca9086afe9b 100644
--- a/chromium/third_party/ffmpeg/libavformat/microdvddec.c
+++ b/chromium/third_party/ffmpeg/libavformat/microdvddec.c
@@ -102,6 +102,8 @@ static int microdvd_read_header(AVFormatContext *s)
if (!len)
break;
line[strcspn(line, "\r\n")] = 0;
+ if (!*p)
+ continue;
if (i++ < 3) {
int frame;
double fps;
diff --git a/chromium/third_party/ffmpeg/libavformat/mov.c b/chromium/third_party/ffmpeg/libavformat/mov.c
index e40bcf3b86f..035171b548a 100644
--- a/chromium/third_party/ffmpeg/libavformat/mov.c
+++ b/chromium/third_party/ffmpeg/libavformat/mov.c
@@ -4588,8 +4588,6 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
MOVTrackExt *trex = NULL;
int flags, track_id, i;
- c->fragment.found_tfhd = 1;
-
avio_r8(pb); /* version */
flags = avio_rb24(pb);
@@ -4605,6 +4603,7 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_WARNING, "could not find corresponding trex (id %u)\n", track_id);
return 0;
}
+ c->fragment.found_tfhd = 1;
frag->track_id = track_id;
set_frag_stream(&c->frag_index, track_id);
@@ -7904,6 +7903,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
}
/* adjust stsd index */
+ if (sc->chunk_count) {
time_sample = 0;
for (i = 0; i < sc->stsc_count; i++) {
int64_t next = time_sample + mov_get_stsc_samples(sc, i);
@@ -7915,6 +7915,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
av_assert0(next == (int)next);
time_sample = next;
}
+ }
return sample;
}
@@ -8036,5 +8037,5 @@ AVInputFormat ff_mov_demuxer = {
.read_packet = mov_read_packet,
.read_close = mov_read_close,
.read_seek = mov_read_seek,
- .flags = AVFMT_NO_BYTE_SEEK,
+ .flags = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS,
};
diff --git a/chromium/third_party/ffmpeg/libavformat/movenc.c b/chromium/third_party/ffmpeg/libavformat/movenc.c
index 46d314ff17d..a96139077b2 100644
--- a/chromium/third_party/ffmpeg/libavformat/movenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/movenc.c
@@ -6219,7 +6219,7 @@ static int mov_init(AVFormatContext *s)
track->par = st->codecpar;
track->language = ff_mov_iso639_to_lang(lang?lang->value:"und", mov->mode!=MODE_MOV);
if (track->language < 0)
- track->language = 0;
+ track->language = 32767; // Unspecified Macintosh language code
track->mode = mov->mode;
track->tag = mov_find_codec_tag(s, track);
if (!track->tag) {
diff --git a/chromium/third_party/ffmpeg/libavformat/mp3enc.c b/chromium/third_party/ffmpeg/libavformat/mp3enc.c
index dd662f5473c..f4814be80e1 100644
--- a/chromium/third_party/ffmpeg/libavformat/mp3enc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mp3enc.c
@@ -391,6 +391,7 @@ static void mp3_update_xing(AVFormatContext *s)
uint16_t tag_crc;
uint8_t *toc;
int i, rg_size;
+ int64_t old_pos = avio_tell(s->pb);
/* replace "Xing" identification string with "Info" for CBR files. */
if (!mp3->has_variable_bitrate)
@@ -450,7 +451,7 @@ static void mp3_update_xing(AVFormatContext *s)
avio_seek(s->pb, mp3->xing_frame_offset, SEEK_SET);
avio_write(s->pb, mp3->xing_frame, mp3->xing_frame_size);
- avio_seek(s->pb, 0, SEEK_END);
+ avio_seek(s->pb, old_pos, SEEK_SET);
}
static int mp3_write_trailer(struct AVFormatContext *s)
diff --git a/chromium/third_party/ffmpeg/libavformat/mpegts.c b/chromium/third_party/ffmpeg/libavformat/mpegts.c
index 8a84e5cc190..47d8d5f8772 100644
--- a/chromium/third_party/ffmpeg/libavformat/mpegts.c
+++ b/chromium/third_party/ffmpeg/libavformat/mpegts.c
@@ -2130,7 +2130,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
return 0;
}
-static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
+static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int programid,
int stream_identifier, int pmt_stream_idx)
{
AVFormatContext *s = ts->stream;
@@ -2139,6 +2139,8 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid,
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
+ if (st->program_num != programid)
+ continue;
if (stream_identifier != -1) { /* match based on "stream identifier descriptor" if present */
if (st->stream_identifier == stream_identifier+1) {
found = st;
@@ -2309,7 +2311,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
pes = ts->pids[pid]->u.pes_filter.opaque;
if (ts->merge_pmt_versions && !pes->st) {
- st = find_matching_stream(ts, pid, stream_identifier, i);
+ st = find_matching_stream(ts, pid, h->id, stream_identifier, i);
if (st) {
pes->st = st;
pes->stream_type = stream_type;
@@ -2331,7 +2333,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt filter probably
pes = add_pes_stream(ts, pid, pcr_pid);
if (ts->merge_pmt_versions && pes && !pes->st) {
- st = find_matching_stream(ts, pid, stream_identifier, i);
+ st = find_matching_stream(ts, pid, h->id, stream_identifier, i);
if (st) {
pes->st = st;
pes->stream_type = stream_type;
@@ -2353,7 +2355,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
st = ts->stream->streams[idx];
}
if (ts->merge_pmt_versions && !st) {
- st = find_matching_stream(ts, pid, stream_identifier, i);
+ st = find_matching_stream(ts, pid, h->id, stream_identifier, i);
}
if (!st) {
st = avformat_new_stream(ts->stream, NULL);
diff --git a/chromium/third_party/ffmpeg/libavformat/mux.c b/chromium/third_party/ffmpeg/libavformat/mux.c
index 83fe1de78fe..21f10caf534 100644
--- a/chromium/third_party/ffmpeg/libavformat/mux.c
+++ b/chromium/third_party/ffmpeg/libavformat/mux.c
@@ -1001,15 +1001,22 @@ static int interleave_compare_dts(AVFormatContext *s, AVPacket *next,
AVStream *st2 = s->streams[next->stream_index];
int comp = av_compare_ts(next->dts, st2->time_base, pkt->dts,
st->time_base);
- if (s->audio_preload && ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) != (st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO))) {
- int64_t ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - s->audio_preload*(st ->codecpar->codec_type == AVMEDIA_TYPE_AUDIO);
- int64_t ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - s->audio_preload*(st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO);
- if (ts == ts2) {
- ts= ( pkt ->dts* st->time_base.num*AV_TIME_BASE - s->audio_preload*(int64_t)(st ->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)* st->time_base.den)*st2->time_base.den
- -( next->dts*st2->time_base.num*AV_TIME_BASE - s->audio_preload*(int64_t)(st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)*st2->time_base.den)* st->time_base.den;
- ts2=0;
+ if (s->audio_preload) {
+ int preload = st ->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
+ int preload2 = st2->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
+ if (preload != preload2) {
+ int64_t ts, ts2;
+ preload *= s->audio_preload;
+ preload2 *= s->audio_preload;
+ ts = av_rescale_q(pkt ->dts, st ->time_base, AV_TIME_BASE_Q) - preload;
+ ts2= av_rescale_q(next->dts, st2->time_base, AV_TIME_BASE_Q) - preload2;
+ if (ts == ts2) {
+ ts = ((uint64_t)pkt ->dts*st ->time_base.num*AV_TIME_BASE - (uint64_t)preload *st ->time_base.den)*st2->time_base.den
+ - ((uint64_t)next->dts*st2->time_base.num*AV_TIME_BASE - (uint64_t)preload2*st2->time_base.den)*st ->time_base.den;
+ ts2 = 0;
+ }
+ comp = (ts2 > ts) - (ts2 < ts);
}
- comp= (ts>ts2) - (ts<ts2);
}
if (comp == 0)
diff --git a/chromium/third_party/ffmpeg/libavformat/mxf.h b/chromium/third_party/ffmpeg/libavformat/mxf.h
index 4394450deaa..f32124f7722 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxf.h
+++ b/chromium/third_party/ffmpeg/libavformat/mxf.h
@@ -48,6 +48,7 @@ enum MXFMetadataSetType {
EssenceGroup,
TaggedValue,
TapeDescriptor,
+ AVCSubDescriptor,
};
enum MXFFrameLayout {
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfdec.c b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
index 3ea8de1666c..bb72fb98416 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfdec.c
@@ -429,19 +429,19 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv, int body_sid
return s->nb_streams == 1 && s->streams[0]->priv_data ? 0 : -1;
}
-static int find_body_sid_by_offset(MXFContext *mxf, int64_t offset)
+static int find_body_sid_by_absolute_offset(MXFContext *mxf, int64_t offset)
{
// we look for partition where the offset is placed
int a, b, m;
- int64_t this_partition;
+ int64_t pack_ofs;
a = -1;
b = mxf->partitions_count;
while (b - a > 1) {
- m = (a + b) >> 1;
- this_partition = mxf->partitions[m].this_partition;
- if (this_partition <= offset)
+ m = (a + b) >> 1;
+ pack_ofs = mxf->partitions[m].pack_ofs;
+ if (pack_ofs <= offset)
a = m;
else
b = m;
@@ -590,7 +590,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv
if (!IS_KLV_KEY(klv, mxf_essence_element_key))
return AVERROR_INVALIDDATA;
- body_sid = find_body_sid_by_offset(mxf, klv->offset);
+ body_sid = find_body_sid_by_absolute_offset(mxf, klv->offset);
index = mxf_get_stream_index(s, klv, body_sid);
if (index < 0)
return AVERROR_INVALIDDATA;
@@ -1545,10 +1545,7 @@ static int mxf_absolute_bodysid_offset(MXFContext *mxf, int body_sid, int64_t of
*/
static int64_t mxf_essence_container_end(MXFContext *mxf, int body_sid)
{
- int x;
- int64_t ret = 0;
-
- for (x = 0; x < mxf->partitions_count; x++) {
+ for (int x = mxf->partitions_count - 1; x >= 0; x--) {
MXFPartition *p = &mxf->partitions[x];
if (p->body_sid != body_sid)
@@ -1557,10 +1554,10 @@ static int64_t mxf_essence_container_end(MXFContext *mxf, int body_sid)
if (!p->essence_length)
return 0;
- ret = p->essence_offset + p->essence_length;
+ return p->essence_offset + p->essence_length;
}
- return ret;
+ return 0;
}
/* EditUnit -> absolute offset */
@@ -2556,6 +2553,24 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
}
}
+ for (int i = 0; i < mxf->fc->nb_streams; i++) {
+ MXFTrack *track1 = mxf->fc->streams[i]->priv_data;
+ if (track1 && track1->body_sid) {
+ for (int j = i + 1; j < mxf->fc->nb_streams; j++) {
+ MXFTrack *track2 = mxf->fc->streams[j]->priv_data;
+ if (track2 && track1->body_sid == track2->body_sid && track1->wrapping != track2->wrapping) {
+ if (track1->wrapping == UnknownWrapped)
+ track1->wrapping = track2->wrapping;
+ else if (track2->wrapping == UnknownWrapped)
+ track2->wrapping = track1->wrapping;
+ else
+ av_log(mxf->fc, AV_LOG_ERROR, "stream %d and stream %d have the same BodySID (%d) "
+ "with different wrapping\n", i, j, track1->body_sid);
+ }
+ }
+ }
+ }
+
ret = 0;
fail_and_free:
return ret;
@@ -3123,9 +3138,12 @@ static void mxf_read_random_index_pack(AVFormatContext *s)
goto end;
avio_seek(s->pb, file_size - length, SEEK_SET);
if (klv_read_packet(&klv, s->pb) < 0 ||
- !IS_KLV_KEY(klv.key, mxf_random_index_pack_key) ||
- klv.length != length - 20)
+ !IS_KLV_KEY(klv.key, mxf_random_index_pack_key))
+ goto end;
+ if (klv.next_klv != file_size || klv.length <= 4 || (klv.length - 4) % 12) {
+ av_log(s, AV_LOG_WARNING, "Invalid RIP KLV length\n");
goto end;
+ }
avio_skip(s->pb, klv.length - 12);
mxf->footer_partition = avio_rb64(s->pb);
@@ -3456,7 +3474,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (IS_KLV_KEY(klv.key, mxf_essence_element_key) ||
IS_KLV_KEY(klv.key, mxf_canopus_essence_element_key) ||
IS_KLV_KEY(klv.key, mxf_avid_essence_element_key)) {
- int body_sid = find_body_sid_by_offset(mxf, klv.offset);
+ int body_sid = find_body_sid_by_absolute_offset(mxf, klv.offset);
int index = mxf_get_stream_index(s, &klv, body_sid);
int64_t next_ofs;
AVStream *st;
diff --git a/chromium/third_party/ffmpeg/libavformat/mxfenc.c b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
index 8c6db94865c..b677f6af8eb 100644
--- a/chromium/third_party/ffmpeg/libavformat/mxfenc.c
+++ b/chromium/third_party/ffmpeg/libavformat/mxfenc.c
@@ -49,12 +49,14 @@
#include "libavcodec/bytestream.h"
#include "libavcodec/dnxhddata.h"
#include "libavcodec/dv_profile.h"
-#include "libavcodec/h264.h"
+#include "libavcodec/h264_ps.h"
+#include "libavcodec/golomb.h"
#include "libavcodec/internal.h"
#include "audiointerleave.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
+#include "avc.h"
#include "mxf.h"
#include "config.h"
@@ -99,6 +101,7 @@ typedef struct MXFStreamContext {
int max_gop; ///< maximum gop size, used by mpeg-2 descriptor
int b_picture_count; ///< maximum number of consecutive b pictures, used in mpeg-2 descriptor
int low_delay; ///< low delay, used in mpeg-2 descriptor
+ int avc_intra;
} MXFStreamContext;
typedef struct MXFContainerEssenceEntry {
@@ -167,6 +170,7 @@ static const struct {
static void mxf_write_wav_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_aes3_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st);
+static void mxf_write_h264_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_generic_sound_desc(AVFormatContext *s, AVStream *st);
static void mxf_write_s436m_anc_desc(AVFormatContext *s, AVStream *st);
@@ -310,7 +314,7 @@ static const MXFContainerEssenceEntry mxf_essence_container_uls[] = {
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x0D,0x01,0x03,0x01,0x02,0x10,0x60,0x01 },
{ 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x15,0x01,0x05,0x00 },
{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x00,0x00,0x00 },
- mxf_write_mpegvideo_desc },
+ mxf_write_h264_desc },
// S436M ANC
{ { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x0D,0x01,0x03,0x01,0x02,0x0e,0x00,0x00 },
{ 0x06,0x0E,0x2B,0x34,0x01,0x02,0x01,0x01,0x0D,0x01,0x03,0x01,0x17,0x01,0x02,0x00 },
@@ -503,6 +507,13 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x3D0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x02,0x01,0x00,0x00,0x00}}, /* Block Align */
};
+static const MXFLocalTagPair mxf_avc_subdescriptor_local_tags[] = {
+ { 0x8100, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x04,0x06,0x10,0x00,0x00}}, /* SubDescriptors */
+ { 0x8200, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x06,0x01,0x0E,0x00,0x00}}, /* AVC Decoding Delay */
+ { 0x8201, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x06,0x01,0x0A,0x00,0x00}}, /* AVC Profile */
+ { 0x8202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x06,0x01,0x0D,0x00,0x00}}, /* AVC Level */
+};
+
static const MXFLocalTagPair mxf_user_comments_local_tag[] = {
{ 0x4406, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x0C,0x00,0x00,0x00}}, /* User Comments */
{ 0x5001, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x02,0x01,0x02,0x09,0x01,0x00,0x00}}, /* Name */
@@ -584,15 +595,33 @@ static int mxf_get_essence_container_ul_index(enum AVCodecID id)
return -1;
}
+static void mxf_write_local_tags(AVIOContext *pb, const MXFLocalTagPair *local_tags, int count)
+{
+ int i;
+ for (i = 0; i < count; i++) {
+ avio_wb16(pb, local_tags[i].local_tag);
+ avio_write(pb, local_tags[i].uid, 16);
+ }
+}
+
static void mxf_write_primer_pack(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
int local_tag_number, i = 0;
+ int avc_tags_count = 0;
local_tag_number = FF_ARRAY_ELEMS(mxf_local_tag_batch);
local_tag_number += mxf->store_user_comments * FF_ARRAY_ELEMS(mxf_user_comments_local_tag);
+ for (i = 0; i < s->nb_streams; i++) {
+ MXFStreamContext *sc = s->streams[i]->priv_data;
+ if (s->streams[i]->codecpar->codec_id == AV_CODEC_ID_H264 && !sc->avc_intra) {
+ avc_tags_count = FF_ARRAY_ELEMS(mxf_avc_subdescriptor_local_tags);
+ local_tag_number += avc_tags_count;
+ }
+ }
+
avio_write(pb, primer_pack_key, 16);
klv_encode_ber_length(pb, local_tag_number * 18 + 8);
@@ -608,6 +637,8 @@ static void mxf_write_primer_pack(AVFormatContext *s)
avio_wb16(pb, mxf_user_comments_local_tag[i].local_tag);
avio_write(pb, mxf_user_comments_local_tag[i].uid, 16);
}
+ if (avc_tags_count > 0)
+ mxf_write_local_tags(pb, mxf_avc_subdescriptor_local_tags, avc_tags_count);
}
static void mxf_write_local_tag(AVIOContext *pb, int size, int tag)
@@ -1126,6 +1157,8 @@ static const UID mxf_aes3_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,
static const UID mxf_cdci_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x28,0x00 };
static const UID mxf_generic_sound_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0D,0x01,0x01,0x01,0x01,0x01,0x42,0x00 };
+static const UID mxf_avc_subdescriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x6E,0x00 };
+
static int get_trc(UID ul, enum AVColorTransferCharacteristic trc)
{
switch (trc){
@@ -1317,6 +1350,13 @@ static int64_t mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID
avio_w8(pb, sc->field_dominance);
}
+ if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !sc->avc_intra) {
+ // write avc sub descriptor ref
+ mxf_write_local_tag(pb, 8 + 16, 0x8100);
+ mxf_write_refs_count(pb, 1);
+ mxf_write_uuid(pb, AVCSubDescriptor, 0);
+ }
+
return pos;
}
@@ -1329,10 +1369,50 @@ static void mxf_update_klv_size(AVIOContext *pb, int64_t pos)
avio_seek(pb, cur_pos, SEEK_SET);
}
+static void mxf_write_avc_subdesc(AVFormatContext *s, AVStream *st)
+{
+ AVIOContext *pb = s->pb;
+ int64_t pos;
+
+ avio_write(pb, mxf_avc_subdescriptor_key, 16);
+ klv_encode_ber4_length(pb, 0);
+ pos = avio_tell(pb);
+
+ mxf_write_local_tag(pb, 16, 0x3C0A);
+ mxf_write_uuid(pb, AVCSubDescriptor, 0);
+
+ mxf_write_local_tag(pb, 1, 0x8200);
+ avio_w8(pb, 0xFF); // AVC Decoding Delay, unknown
+
+ mxf_write_local_tag(pb, 1, 0x8201);
+ avio_w8(pb, st->codecpar->profile); // AVC Profile
+
+ mxf_write_local_tag(pb, 1, 0x8202);
+ avio_w8(pb, st->codecpar->level); // AVC Level
+
+ mxf_update_klv_size(s->pb, pos);
+}
+
static void mxf_write_cdci_desc(AVFormatContext *s, AVStream *st)
{
int64_t pos = mxf_write_cdci_common(s, st, mxf_cdci_descriptor_key);
mxf_update_klv_size(s->pb, pos);
+
+ if (st->codecpar->codec_id == AV_CODEC_ID_H264) {
+ mxf_write_avc_subdesc(s, st);
+ }
+}
+
+static void mxf_write_h264_desc(AVFormatContext *s, AVStream *st)
+{
+ MXFStreamContext *sc = st->priv_data;
+ if (sc->avc_intra) {
+ mxf_write_mpegvideo_desc(s, st);
+ } else {
+ int64_t pos = mxf_write_cdci_common(s, st, mxf_cdci_descriptor_key);
+ mxf_update_klv_size(s->pb, pos);
+ mxf_write_avc_subdesc(s, st);
+ }
}
static void mxf_write_s436m_anc_desc(AVFormatContext *s, AVStream *st)
@@ -2136,30 +2216,30 @@ static const struct {
int frame_size;
int profile;
uint8_t interlaced;
- int long_gop; // 1 or 0 when there are separate UIDs for Long GOP and Intra, -1 when Intra/LGOP detection can be ignored
+ int intra_only; // 1 or 0 when there are separate UIDs for Long GOP and Intra, -1 when Intra/LGOP detection can be ignored
} mxf_h264_codec_uls[] = {
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x11,0x01 }, 0, 66, 0, -1 }, // AVC Baseline, Unconstrained Coding
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x11,0x01 }, 0, 66, 0, -1 }, // AVC Baseline
{{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x20,0x01 }, 0, 77, 0, -1 }, // AVC Main
{{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x30,0x01 }, 0, 88, 0, -1 }, // AVC Extended
{{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x40,0x01 }, 0, 100, 0, -1 }, // AVC High
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x50,0x01 }, 0, 110, 0, 1 }, // AVC High 10
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x60,0x01 }, 0, 122, 0, 1 }, // AVC High 422
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x70,0x01 }, 0, 244, 0, 1 }, // AVC High 444
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x20,0x01 }, 0, 110, 0, 0 }, // AVC High 10 Intra
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x01 }, 232960, 0, 1, 0 }, // AVC Intra 50 1080i60
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x02 }, 281088, 0, 1, 0 }, // AVC Intra 50 1080i50
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x03 }, 232960, 0, 0, 0 }, // AVC Intra 50 1080p30
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x04 }, 281088, 0, 0, 0 }, // AVC Intra 50 1080p25
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x08 }, 116736, 0, 0, 0 }, // AVC Intra 50 720p60
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x09 }, 140800, 0, 0, 0 }, // AVC Intra 50 720p50
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x30,0x01 }, 0, 122, 0, 0 }, // AVC High 422 Intra
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x01 }, 472576, 0, 1, 0 }, // AVC Intra 100 1080i60
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x02 }, 568832, 0, 1, 0 }, // AVC Intra 100 1080i50
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x03 }, 472576, 0, 0, 0 }, // AVC Intra 100 1080p30
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x04 }, 568832, 0, 0, 0 }, // AVC Intra 100 1080p25
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x08 }, 236544, 0, 0, 0 }, // AVC Intra 100 720p60
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x09 }, 284672, 0, 0, 0 }, // AVC Intra 100 720p50
- {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x01,0x32,0x40,0x01 }, 0, 244, 0, 0 }, // AVC High 444 Intra
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x50,0x01 }, 0, 110, 0, 0 }, // AVC High 10
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x60,0x01 }, 0, 122, 0, 0 }, // AVC High 422
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x31,0x70,0x01 }, 0, 244, 0, 0 }, // AVC High 444
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x20,0x01 }, 0, 110, 0, 1 }, // AVC High 10 Intra
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x01 }, 232960, 110, 1, 1 }, // AVC High 10 Intra RP2027 Class 50 1080/59.94i
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x02 }, 281088, 110, 1, 1 }, // AVC High 10 Intra RP2027 Class 50 1080/50i
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x03 }, 232960, 110, 0, 1 }, // AVC High 10 Intra RP2027 Class 50 1080/29.97p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x04 }, 281088, 110, 0, 1 }, // AVC High 10 Intra RP2027 Class 50 1080/25p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x08 }, 116736, 110, 0, 1 }, // AVC High 10 Intra RP2027 Class 50 720/59.94p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x21,0x09 }, 140800, 110, 0, 1 }, // AVC High 10 Intra RP2027 Class 50 720/50p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x30,0x01 }, 0, 122, 0, 1 }, // AVC High 422 Intra
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x01 }, 472576, 122, 1, 1 }, // AVC High 422 Intra RP2027 Class 100 1080/59.94i
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x02 }, 568832, 122, 1, 1 }, // AVC High 422 Intra RP2027 Class 100 1080/50i
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x03 }, 472576, 122, 0, 1 }, // AVC High 422 Intra RP2027 Class 100 1080/29.97p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x04 }, 568832, 122, 0, 1 }, // AVC High 422 Intra RP2027 Class 100 1080/25p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x08 }, 236544, 122, 0, 1 }, // AVC High 422 Intra RP2027 Class 100 720/59.94p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0a,0x04,0x01,0x02,0x02,0x01,0x32,0x31,0x09 }, 284672, 122, 0, 1 }, // AVC High 422 Intra RP2027 Class 100 720/50p
+ {{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x01,0x32,0x40,0x01 }, 0, 244, 0, 1 }, // AVC High 444 Intra
{{ 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x01,0x32,0x50,0x01 }, 0, 44, 0, -1 }, // AVC CAVLC 444
};
@@ -2168,37 +2248,70 @@ static int mxf_parse_h264_frame(AVFormatContext *s, AVStream *st,
{
MXFContext *mxf = s->priv_data;
MXFStreamContext *sc = st->priv_data;
- AVCodecParameters *par = st->codecpar;
- static const int mxf_h264_num_codec_uls = sizeof(mxf_h264_codec_uls) / sizeof(mxf_h264_codec_uls[0]);
+ H264SequenceParameterSet *sps = NULL;
+ GetBitContext gb;
const uint8_t *buf = pkt->data;
const uint8_t *buf_end = pkt->data + pkt->size;
+ const uint8_t *nal_end;
uint32_t state = -1;
- int long_gop = 0; // assume intra when there is no SPS header
int extra_size = 512; // support AVC Intra files without SPS/PPS header
- int i, frame_size;
- uint8_t uid_found;
-
- if (pkt->size > extra_size)
- buf_end -= pkt->size - extra_size; // no need to parse beyond SPS/PPS header
+ int i, frame_size, slice_type, intra_only = 0;
for (;;) {
buf = avpriv_find_start_code(buf, buf_end, &state);
if (buf >= buf_end)
break;
- --buf;
+
switch (state & 0x1f) {
case H264_NAL_SPS:
- par->profile = buf[1];
- long_gop = buf[2] & 0x10 ? 0 : 1; // constraint_set3_flag signals intra
e->flags |= 0x40;
+
+ if (mxf->header_written)
+ break;
+
+ nal_end = ff_avc_find_startcode(buf, buf_end);
+ sps = ff_avc_decode_sps(buf, nal_end - buf);
+ if (!sps) {
+ av_log(s, AV_LOG_ERROR, "error parsing sps\n");
+ return 0;
+ }
+
+ sc->aspect_ratio.num = st->codecpar->width * sps->sar.num;
+ sc->aspect_ratio.den = st->codecpar->height * sps->sar.den;
+ av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
+ sc->aspect_ratio.num, sc->aspect_ratio.den, 1024*1024);
+ intra_only = (sps->constraint_set_flags >> 3) & 1;
+ sc->interlaced = !sps->frame_mbs_only_flag;
+ sc->component_depth = sps->bit_depth_luma;
+
+ buf = nal_end;
break;
case H264_NAL_PPS:
if (e->flags & 0x40) { // sequence header present
e->flags |= 0x80; // random access
extra_size = 0;
- buf = buf_end;
}
break;
+ case H264_NAL_IDR_SLICE:
+ e->flags |= 0x04; // IDR Picture
+ buf = buf_end;
+ break;
+ case H264_NAL_SLICE:
+ init_get_bits8(&gb, buf, buf_end - buf);
+ get_ue_golomb_long(&gb); // skip first_mb_in_slice
+ slice_type = get_ue_golomb_31(&gb);
+ switch (slice_type % 5) {
+ case 0:
+ e->flags |= 0x20; // P Picture
+ e->flags |= 0x06; // P Picture
+ break;
+ case 1:
+ e->flags |= 0x30; // B Picture
+ e->flags |= 0x03; // non-referenced B Picture
+ break;
+ }
+ buf = buf_end;
+ break;
default:
break;
}
@@ -2207,27 +2320,37 @@ static int mxf_parse_h264_frame(AVFormatContext *s, AVStream *st,
if (mxf->header_written)
return 1;
- sc->aspect_ratio = (AVRational){ 16, 9 }; // 16:9 is mandatory for broadcast HD
- sc->interlaced = par->field_order != AV_FIELD_PROGRESSIVE ? 1 : 0;
-
- uid_found = 0;
+ if (!sps)
+ sc->interlaced = st->codecpar->field_order != AV_FIELD_PROGRESSIVE ? 1 : 0;
+ sc->codec_ul = NULL;
frame_size = pkt->size + extra_size;
- for (i = 0; i < mxf_h264_num_codec_uls; i++) {
+
+ for (i = 0; i < FF_ARRAY_ELEMS(mxf_h264_codec_uls); i++) {
if (frame_size == mxf_h264_codec_uls[i].frame_size && sc->interlaced == mxf_h264_codec_uls[i].interlaced) {
sc->codec_ul = &mxf_h264_codec_uls[i].uid;
sc->component_depth = 10; // AVC Intra is always 10 Bit
+ sc->aspect_ratio = (AVRational){ 16, 9 }; // 16:9 is mandatory for broadcast HD
+ st->codecpar->profile = mxf_h264_codec_uls[i].profile;
+ sc->avc_intra = 1;
+ mxf->cbr_index = 1;
+ sc->frame_size = pkt->size;
if (sc->interlaced)
sc->field_dominance = 1; // top field first is mandatory for AVC Intra
- return 1;
- } else if ((mxf_h264_codec_uls[i].profile == par->profile) &&
- ((mxf_h264_codec_uls[i].long_gop < 0) ||
- (mxf_h264_codec_uls[i].long_gop == long_gop))) {
+ break;
+ } else if (sps && mxf_h264_codec_uls[i].frame_size == 0 &&
+ mxf_h264_codec_uls[i].profile == sps->profile_idc &&
+ (mxf_h264_codec_uls[i].intra_only < 0 ||
+ mxf_h264_codec_uls[i].intra_only == intra_only)) {
sc->codec_ul = &mxf_h264_codec_uls[i].uid;
- uid_found = 1;
+ st->codecpar->profile = sps->profile_idc;
+ st->codecpar->level = sps->level_idc;
+ // continue to check for avc intra
}
}
- if (!uid_found) {
+ av_free(sps);
+
+ if (!sc->codec_ul) {
av_log(s, AV_LOG_ERROR, "h264 profile not supported\n");
return 0;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/nut.c b/chromium/third_party/ffmpeg/libavformat/nut.c
index 4fbbcb1d266..937f452878d 100644
--- a/chromium/third_party/ffmpeg/libavformat/nut.c
+++ b/chromium/third_party/ffmpeg/libavformat/nut.c
@@ -43,6 +43,7 @@ const AVCodecTag ff_nut_video_tags[] = {
{ AV_CODEC_ID_XFACE, MKTAG('X', 'F', 'A', 'C') },
{ AV_CODEC_ID_VP9, MKTAG('V', 'P', '9', '0') },
{ AV_CODEC_ID_HEVC, MKTAG('H', 'E', 'V', 'C') },
+ { AV_CODEC_ID_CPIA, MKTAG('C', 'P', 'i', 'A') },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
{ AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 16 ) },
diff --git a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
index a07453760b7..b07a5d55ba0 100644
--- a/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
+++ b/chromium/third_party/ffmpeg/libavformat/oggparseogm.c
@@ -114,6 +114,9 @@ ogm_header(AVFormatContext *s, int idx)
bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);
}
}
+
+ // Update internal avctx with changes to codecpar above.
+ st->internal->need_context_update = 1;
} else if (bytestream2_peek_byte(&p) == 3) {
bytestream2_skip(&p, 7);
if (bytestream2_get_bytes_left(&p) > 1)
diff --git a/chromium/third_party/ffmpeg/libavformat/riff.c b/chromium/third_party/ffmpeg/libavformat/riff.c
index 0f5cd62547f..e755ad8d5fb 100644
--- a/chromium/third_party/ffmpeg/libavformat/riff.c
+++ b/chromium/third_party/ffmpeg/libavformat/riff.c
@@ -307,6 +307,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_INDEO5, MKTAG('I', 'V', '5', '0') },
{ AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
{ AV_CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
+ { AV_CODEC_ID_VP4, MKTAG('V', 'P', '4', '0') },
{ AV_CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '0') },
{ AV_CODEC_ID_VP6, MKTAG('V', 'P', '6', '1') },
@@ -453,6 +454,7 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'R', 'G') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'G', '0') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'Y', '2') },
+ { AV_CODEC_ID_MAGICYUV, MKTAG('M', '0', 'Y', '4') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '2', 'R', 'A') },
{ AV_CODEC_ID_MAGICYUV, MKTAG('M', '2', 'R', 'G') },
{ AV_CODEC_ID_YLC, MKTAG('Y', 'L', 'C', '0') },
diff --git a/chromium/third_party/ffmpeg/libavformat/rpl.c b/chromium/third_party/ffmpeg/libavformat/rpl.c
index fa6357666a5..6afd3738100 100644
--- a/chromium/third_party/ffmpeg/libavformat/rpl.c
+++ b/chromium/third_party/ffmpeg/libavformat/rpl.c
@@ -124,7 +124,7 @@ static int rpl_read_header(AVFormatContext *s)
uint32_t i;
- int32_t audio_format, chunk_catalog_offset, number_of_chunks;
+ int32_t video_format, audio_format, chunk_catalog_offset, number_of_chunks;
AVRational fps;
char line[RPL_LINE_LENGTH];
@@ -144,39 +144,47 @@ static int rpl_read_header(AVFormatContext *s)
av_dict_set(&s->metadata, "author" , line, 0);
// video headers
- vst = avformat_new_stream(s, NULL);
- if (!vst)
- return AVERROR(ENOMEM);
- vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- vst->codecpar->codec_tag = read_line_and_int(pb, &error); // video format
- vst->codecpar->width = read_line_and_int(pb, &error); // video width
- vst->codecpar->height = read_line_and_int(pb, &error); // video height
- vst->codecpar->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample
- error |= read_line(pb, line, sizeof(line)); // video frames per second
- fps = read_fps(line, &error);
- avpriv_set_pts_info(vst, 32, fps.den, fps.num);
-
- // Figure out the video codec
- switch (vst->codecpar->codec_tag) {
+ video_format = read_line_and_int(pb, &error);
+ if (video_format) {
+ vst = avformat_new_stream(s, NULL);
+ if (!vst)
+ return AVERROR(ENOMEM);
+ vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ vst->codecpar->codec_tag = video_format;
+ vst->codecpar->width = read_line_and_int(pb, &error); // video width
+ vst->codecpar->height = read_line_and_int(pb, &error); // video height
+ vst->codecpar->bits_per_coded_sample = read_line_and_int(pb, &error); // video bits per sample
+
+ // Figure out the video codec
+ switch (vst->codecpar->codec_tag) {
#if 0
- case 122:
- vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE122;
- break;
+ case 122:
+ vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE122;
+ break;
#endif
- case 124:
- vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE124;
- // The header is wrong here, at least sometimes
- vst->codecpar->bits_per_coded_sample = 16;
- break;
- case 130:
- vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE130;
- break;
- default:
- avpriv_report_missing_feature(s, "Video format %s",
- av_fourcc2str(vst->codecpar->codec_tag));
- vst->codecpar->codec_id = AV_CODEC_ID_NONE;
+ case 124:
+ vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE124;
+ // The header is wrong here, at least sometimes
+ vst->codecpar->bits_per_coded_sample = 16;
+ break;
+ case 130:
+ vst->codecpar->codec_id = AV_CODEC_ID_ESCAPE130;
+ break;
+ default:
+ avpriv_report_missing_feature(s, "Video format %s",
+ av_fourcc2str(vst->codecpar->codec_tag));
+ vst->codecpar->codec_id = AV_CODEC_ID_NONE;
+ }
+ } else {
+ for (i = 0; i < 3; i++)
+ error |= read_line(pb, line, sizeof(line));
}
+ error |= read_line(pb, line, sizeof(line)); // video frames per second
+ fps = read_fps(line, &error);
+ if (vst)
+ avpriv_set_pts_info(vst, 32, fps.den, fps.num);
+
// Audio headers
// ARMovie supports multiple audio tracks; I don't have any
@@ -192,7 +200,7 @@ static int rpl_read_header(AVFormatContext *s)
ast->codecpar->channels = read_line_and_int(pb, &error); // number of audio channels
error |= read_line(pb, line, sizeof(line));
ast->codecpar->bits_per_coded_sample = read_int(line, &endptr, &error); // audio bits per sample
- strcpy(audio_type, endptr);
+ av_strlcpy(audio_type, endptr, RPL_LINE_LENGTH);
// At least one sample uses 0 for ADPCM, which is really 4 bits
// per sample.
if (ast->codecpar->bits_per_coded_sample == 0)
@@ -210,10 +218,10 @@ static int rpl_read_header(AVFormatContext *s)
ast->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
break;
} else if (ast->codecpar->bits_per_coded_sample == 8) {
- if(strstr(audio_type, "unsigned") != NULL) {
+ if(av_stristr(audio_type, "unsigned") != NULL) {
ast->codecpar->codec_id = AV_CODEC_ID_PCM_U8;
break;
- } else if(strstr(audio_type, "linear") != NULL) {
+ } else if(av_stristr(audio_type, "linear") != NULL) {
ast->codecpar->codec_id = AV_CODEC_ID_PCM_S8;
break;
} else {
@@ -246,7 +254,7 @@ static int rpl_read_header(AVFormatContext *s)
}
rpl->frames_per_chunk = read_line_and_int(pb, &error); // video frames per chunk
- if (rpl->frames_per_chunk > 1 && vst->codecpar->codec_tag != 124)
+ if (vst && rpl->frames_per_chunk > 1 && vst->codecpar->codec_tag != 124)
av_log(s, AV_LOG_WARNING,
"Don't know how to split frames for video format %s. "
"Video stream will be broken!\n", av_fourcc2str(vst->codecpar->codec_tag));
@@ -261,7 +269,10 @@ static int rpl_read_header(AVFormatContext *s)
read_line_and_int(pb, &error); // (file index)
error |= read_line(pb, line, sizeof(line)); // offset to "helpful" sprite
error |= read_line(pb, line, sizeof(line)); // size of "helpful" sprite
- error |= read_line(pb, line, sizeof(line)); // offset to key frame list
+ if (vst) {
+ error |= read_line(pb, line, sizeof(line)); // offset to key frame list
+ vst->duration = number_of_chunks * rpl->frames_per_chunk;
+ }
// Read the index
avio_seek(pb, chunk_catalog_offset, SEEK_SET);
@@ -274,8 +285,9 @@ static int rpl_read_header(AVFormatContext *s)
error = -1;
continue;
}
- av_add_index_entry(vst, offset, i * rpl->frames_per_chunk,
- video_size, rpl->frames_per_chunk, 0);
+ if (vst)
+ av_add_index_entry(vst, offset, i * rpl->frames_per_chunk,
+ video_size, rpl->frames_per_chunk, 0);
if (ast)
av_add_index_entry(ast, offset + video_size, total_audio_size,
audio_size, audio_size * 8, 0);
diff --git a/chromium/third_party/ffmpeg/libavformat/rtsp.c b/chromium/third_party/ffmpeg/libavformat/rtsp.c
index 8349840c96f..c153cac88b1 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtsp.c
+++ b/chromium/third_party/ffmpeg/libavformat/rtsp.c
@@ -76,7 +76,8 @@
#define COMMON_OPTS() \
{ "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 }, \
- { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC } \
+ { "buffer_size", "Underlying protocol send/receive buffer size", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \
+ { "pkt_size", "Underlying protocol send packet size", OFFSET(pkt_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, ENC } \
const AVOption ff_rtsp_options[] = {
@@ -132,6 +133,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
av_dict_set(&opts, "buffer_size", buf, 0);
+ snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
+ av_dict_set(&opts, "pkt_size", buf, 0);
return opts;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/rtsp.h b/chromium/third_party/ffmpeg/libavformat/rtsp.h
index b49278fc203..54a9a30c16f 100644
--- a/chromium/third_party/ffmpeg/libavformat/rtsp.h
+++ b/chromium/third_party/ffmpeg/libavformat/rtsp.h
@@ -410,6 +410,7 @@ typedef struct RTSPState {
char default_lang[4];
int buffer_size;
+ int pkt_size;
} RTSPState;
#define RTSP_FLAG_FILTER_SRC 0x1 /**< Filter incoming UDP packets -
diff --git a/chromium/third_party/ffmpeg/libavformat/sbgdec.c b/chromium/third_party/ffmpeg/libavformat/sbgdec.c
index 67ae39698e5..4155395da07 100644
--- a/chromium/third_party/ffmpeg/libavformat/sbgdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/sbgdec.c
@@ -197,7 +197,7 @@ static int str_to_time(const char *str, int64_t *rtime)
if (end > cur + 1)
cur = end;
}
- *rtime = (hours * 3600 + minutes * 60 + seconds) * AV_TIME_BASE;
+ *rtime = (hours * 3600LL + minutes * 60LL + seconds) * AV_TIME_BASE;
return cur - str;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/sccdec.c b/chromium/third_party/ffmpeg/libavformat/sccdec.c
index 006300fbcc3..412d8aaf49e 100644
--- a/chromium/third_party/ffmpeg/libavformat/sccdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/sccdec.c
@@ -110,6 +110,7 @@ static int scc_read_header(AVFormatContext *s)
ts_end = (hh2 * 3600LL + mm2 * 60LL + ss2) * 1000LL + fs2 * 33;
count++;
+try_again:
lline = (char *)&line;
lline += 12;
@@ -138,9 +139,13 @@ static int scc_read_header(AVFormatContext *s)
sub->pts = ts_start;
sub->duration = FFMAX(1200, ts_end - ts_start);
memmove(line, line2, sizeof(line));
+ line2[0] = 0;
FFSWAP(ptrdiff_t, len, len2);
}
+ if (line[0])
+ goto try_again;
+
ff_subtitles_queue_finalize(s, &scc->q);
return ret;
diff --git a/chromium/third_party/ffmpeg/libavformat/segment.c b/chromium/third_party/ffmpeg/libavformat/segment.c
index 90004600bdf..e3082063d8f 100644
--- a/chromium/third_party/ffmpeg/libavformat/segment.c
+++ b/chromium/third_party/ffmpeg/libavformat/segment.c
@@ -180,6 +180,13 @@ static int segment_mux_init(AVFormatContext *s)
}
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
st->time_base = s->streams[i]->time_base;
+ st->avg_frame_rate = s->streams[i]->avg_frame_rate;
+#if FF_API_LAVF_AVCTX
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (s->streams[i]->codecpar->codec_tag == MKTAG('t','m','c','d'))
+ st->codec->time_base = s->streams[i]->codec->time_base;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
av_dict_copy(&st->metadata, s->streams[i]->metadata, 0);
}
@@ -421,7 +428,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
rate = s->streams[i]->avg_frame_rate;/* Get fps from the video stream */
err = av_timecode_init_from_string(&tc, rate, tcr->value, s);
if (err < 0) {
- av_log(s, AV_LOG_WARNING, "Could not increment timecode, error occurred during timecode creation.");
+ av_log(s, AV_LOG_WARNING, "Could not increment global timecode, error occurred during timecode creation.\n");
break;
}
tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(rate));/* increment timecode */
@@ -431,7 +438,23 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
}
}
} else {
- av_log(s, AV_LOG_WARNING, "Could not increment timecode, no timecode metadata found");
+ av_log(s, AV_LOG_WARNING, "Could not increment global timecode, no global timecode metadata found.\n");
+ }
+ for (i = 0; i < s->nb_streams; i++) {
+ if (s->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
+ char st_buf[AV_TIMECODE_STR_SIZE];
+ AVTimecode st_tc;
+ AVRational st_rate = s->streams[i]->avg_frame_rate;
+ AVDictionaryEntry *st_tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0);
+ if (st_tcr) {
+ if ((av_timecode_init_from_string(&st_tc, st_rate, st_tcr->value, s) < 0)) {
+ av_log(s, AV_LOG_WARNING, "Could not increment stream %d timecode, error occurred during timecode creation.\n", i);
+ continue;
+ }
+ st_tc.start += (int)((seg->cur_entry.end_time - seg->cur_entry.start_time) * av_q2d(st_rate)); // increment timecode
+ av_dict_set(&s->streams[i]->metadata, "timecode", av_timecode_make_string(&st_tc, st_buf, 0), 0);
+ }
+ }
}
}
@@ -859,6 +882,20 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
if (!seg->avf || !seg->avf->pb)
return AVERROR(EINVAL);
+ if (!st->codecpar->extradata_size) {
+ int pkt_extradata_size = 0;
+ uint8_t *pkt_extradata = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &pkt_extradata_size);
+ if (pkt_extradata && pkt_extradata_size > 0) {
+ ret = ff_alloc_extradata(st->codecpar, pkt_extradata_size);
+ if (ret < 0) {
+ av_log(s, AV_LOG_WARNING, "Unable to add extradata to stream. Output segments may be invalid.\n");
+ goto calc_times;
+ }
+ memcpy(st->codecpar->extradata, pkt_extradata, pkt_extradata_size);
+ st->codecpar->extradata_size = pkt_extradata_size;
+ }
+ }
+
calc_times:
if (seg->times) {
end_pts = seg->segment_count < seg->nb_times ?
diff --git a/chromium/third_party/ffmpeg/libavformat/subfile.c b/chromium/third_party/ffmpeg/libavformat/subfile.c
index b527f2bee17..2f162e0a34d 100644
--- a/chromium/third_party/ffmpeg/libavformat/subfile.c
+++ b/chromium/third_party/ffmpeg/libavformat/subfile.c
@@ -116,11 +116,17 @@ static int subfile_read(URLContext *h, unsigned char *buf, int size)
static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
{
SubfileContext *c = h->priv_data;
- int64_t new_pos = -1;
+ int64_t new_pos = -1, end;
int ret;
+ if (whence == AVSEEK_SIZE || whence == SEEK_END) {
+ end = c->end;
+ if (end == INT64_MAX && (end = ffurl_seek(c->h, 0, AVSEEK_SIZE)) < 0)
+ return end;
+ }
+
if (whence == AVSEEK_SIZE)
- return c->end - c->start;
+ return end - c->start;
switch (whence) {
case SEEK_SET:
new_pos = c->start + pos;
@@ -129,7 +135,7 @@ static int64_t subfile_seek(URLContext *h, int64_t pos, int whence)
new_pos += pos;
break;
case SEEK_END:
- new_pos = c->end + c->pos;
+ new_pos = end + c->pos;
break;
}
if (new_pos < c->start)
diff --git a/chromium/third_party/ffmpeg/libavformat/subtitles.c b/chromium/third_party/ffmpeg/libavformat/subtitles.c
index 93c9ef05cf0..659c99d1cf7 100644
--- a/chromium/third_party/ffmpeg/libavformat/subtitles.c
+++ b/chromium/third_party/ffmpeg/libavformat/subtitles.c
@@ -417,7 +417,7 @@ ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size)
buf[cur++] = c;
buf[cur] = '\0';
}
- if (ff_text_peek_r8(tr) == '\r')
+ while (ff_text_peek_r8(tr) == '\r')
ff_text_r8(tr);
if (ff_text_peek_r8(tr) == '\n')
ff_text_r8(tr);
diff --git a/chromium/third_party/ffmpeg/libavformat/subtitles.h b/chromium/third_party/ffmpeg/libavformat/subtitles.h
index ca78db224d5..6b418e36211 100644
--- a/chromium/third_party/ffmpeg/libavformat/subtitles.h
+++ b/chromium/third_party/ffmpeg/libavformat/subtitles.h
@@ -188,7 +188,7 @@ static av_always_inline int ff_subtitles_next_line(const char *ptr)
{
int n = strcspn(ptr, "\r\n");
ptr += n;
- if (*ptr == '\r') {
+ while (*ptr == '\r') {
ptr++;
n++;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/tiertexseq.c b/chromium/third_party/ffmpeg/libavformat/tiertexseq.c
index e861869ad3a..a89a0a9d614 100644
--- a/chromium/third_party/ffmpeg/libavformat/tiertexseq.c
+++ b/chromium/third_party/ffmpeg/libavformat/tiertexseq.c
@@ -182,6 +182,17 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, AVIOContext *pb)
return 0;
}
+static int seq_read_close(AVFormatContext *s)
+{
+ int i;
+ SeqDemuxContext *seq = s->priv_data;
+
+ for (i = 0; i < SEQ_NUM_FRAME_BUFFERS; i++)
+ av_freep(&seq->frame_buffers[i].data);
+
+ return 0;
+}
+
static int seq_read_header(AVFormatContext *s)
{
int i, rc;
@@ -191,16 +202,20 @@ static int seq_read_header(AVFormatContext *s)
/* init internal buffers */
rc = seq_init_frame_buffers(seq, pb);
- if (rc)
+ if (rc) {
+ seq_read_close(s);
return rc;
+ }
seq->current_frame_offs = 0;
/* preload (no audio data, just buffer operations related data) */
for (i = 1; i <= 100; i++) {
rc = seq_parse_frame_data(seq, pb);
- if (rc)
+ if (rc) {
+ seq_read_close(s);
return rc;
+ }
}
seq->current_frame_pts = 0;
@@ -209,8 +224,10 @@ static int seq_read_header(AVFormatContext *s)
/* initialize the video decoder stream */
st = avformat_new_stream(s, NULL);
- if (!st)
+ if (!st) {
+ seq_read_close(s);
return AVERROR(ENOMEM);
+ }
avpriv_set_pts_info(st, 32, 1, SEQ_FRAME_RATE);
seq->video_stream_index = st->index;
@@ -222,8 +239,10 @@ static int seq_read_header(AVFormatContext *s)
/* initialize the audio decoder stream */
st = avformat_new_stream(s, NULL);
- if (!st)
+ if (!st) {
+ seq_read_close(s);
return AVERROR(ENOMEM);
+ }
st->start_time = 0;
avpriv_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE);
@@ -295,17 +314,6 @@ static int seq_read_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
-static int seq_read_close(AVFormatContext *s)
-{
- int i;
- SeqDemuxContext *seq = s->priv_data;
-
- for (i = 0; i < SEQ_NUM_FRAME_BUFFERS; i++)
- av_freep(&seq->frame_buffers[i].data);
-
- return 0;
-}
-
AVInputFormat ff_tiertexseq_demuxer = {
.name = "tiertexseq",
.long_name = NULL_IF_CONFIG_SMALL("Tiertex Limited SEQ"),
diff --git a/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c b/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
index e3c43683be5..f32bc2821b8 100644
--- a/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
+++ b/chromium/third_party/ffmpeg/libavformat/tls_gnutls.c
@@ -182,11 +182,13 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op
gnutls_transport_set_push_function(p->session, gnutls_url_push);
gnutls_transport_set_ptr(p->session, c->tcp);
gnutls_priority_set_direct(p->session, "NORMAL", NULL);
- ret = gnutls_handshake(p->session);
- if (ret) {
- ret = print_tls_error(h, ret);
- goto fail;
- }
+ do {
+ ret = gnutls_handshake(p->session);
+ if (gnutls_error_is_fatal(ret)) {
+ ret = print_tls_error(h, ret);
+ goto fail;
+ }
+ } while (ret);
p->need_shutdown = 1;
if (c->verify) {
unsigned int status, cert_list_size;
diff --git a/chromium/third_party/ffmpeg/libavformat/utils.c b/chromium/third_party/ffmpeg/libavformat/utils.c
index 39c118f9e89..61a0be02eb1 100644
--- a/chromium/third_party/ffmpeg/libavformat/utils.c
+++ b/chromium/third_party/ffmpeg/libavformat/utils.c
@@ -2948,6 +2948,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
AVStream av_unused *st;
for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
+ if (st->time_base.den)
av_log(ic, AV_LOG_TRACE, "stream %d: start_time: %0.3f duration: %0.3f\n", i,
(double) st->start_time * av_q2d(st->time_base),
(double) st->duration * av_q2d(st->time_base));
@@ -4213,7 +4214,8 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
continue;
}
}
- disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED));
+ disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED))
+ + !! (st->disposition & AV_DISPOSITION_DEFAULT);
count = st->codec_info_nb_frames;
bitrate = par->bit_rate;
multiframe = FFMIN(5, count);
@@ -4725,7 +4727,7 @@ void av_url_split(char *proto, int proto_size,
char *hostname, int hostname_size,
int *port_ptr, char *path, int path_size, const char *url)
{
- const char *p, *ls, *ls2, *ls3, *at, *at2, *col, *brk;
+ const char *p, *ls, *ls2, *at, *at2, *col, *brk;
if (port_ptr)
*port_ptr = -1;
@@ -4755,9 +4757,6 @@ void av_url_split(char *proto, int proto_size,
/* separate path from hostname */
ls = strchr(p, '/');
ls2 = strchr(p, '?');
- ls3 = strchr(p, '@');
- if (ls3 && ls3 > ls && (!ls2 || ls2 > ls3))
- ls = strchr(ls3, '/');
if (!ls)
ls = ls2;
else if (ls && ls2)
@@ -5105,7 +5104,7 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f
* >0 if st is a matching stream
*/
static int match_stream_specifier(AVFormatContext *s, AVStream *st,
- const char *spec, const char **indexptr)
+ const char *spec, const char **indexptr, AVProgram **p)
{
int match = 1; /* Stores if the specifier matches so far. */
while (*spec) {
@@ -5160,6 +5159,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
for (j = 0; j < s->programs[i]->nb_stream_indexes; j++) {
if (st->index == s->programs[i]->stream_index[j]) {
found = 1;
+ if (p)
+ *p = s->programs[i];
i = s->nb_programs;
break;
}
@@ -5262,8 +5263,10 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
int ret, index;
char *endptr;
const char *indexptr = NULL;
+ AVProgram *p = NULL;
+ int nb_streams;
- ret = match_stream_specifier(s, st, spec, &indexptr);
+ ret = match_stream_specifier(s, st, spec, &indexptr, &p);
if (ret < 0)
goto error;
@@ -5281,11 +5284,13 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
return (index == st->index);
/* If we requested a matching stream index, we have to ensure st is that. */
- for (int i = 0; i < s->nb_streams && index >= 0; i++) {
- ret = match_stream_specifier(s, s->streams[i], spec, NULL);
+ nb_streams = p ? p->nb_stream_indexes : s->nb_streams;
+ for (int i = 0; i < nb_streams && index >= 0; i++) {
+ AVStream *candidate = p ? s->streams[p->stream_index[i]] : s->streams[i];
+ ret = match_stream_specifier(s, candidate, spec, NULL, NULL);
if (ret < 0)
goto error;
- if (ret > 0 && index-- == 0 && st == s->streams[i])
+ if (ret > 0 && index-- == 0 && st == candidate)
return 1;
}
return 0;
diff --git a/chromium/third_party/ffmpeg/libavformat/version.h b/chromium/third_party/ffmpeg/libavformat/version.h
index 150a72e27d7..fbce72fcc96 100644
--- a/chromium/third_party/ffmpeg/libavformat/version.h
+++ b/chromium/third_party/ffmpeg/libavformat/version.h
@@ -32,8 +32,8 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
-#define LIBAVFORMAT_VERSION_MINOR 27
-#define LIBAVFORMAT_VERSION_MICRO 103
+#define LIBAVFORMAT_VERSION_MINOR 28
+#define LIBAVFORMAT_VERSION_MICRO 102
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libavformat/vividas.c b/chromium/third_party/ffmpeg/libavformat/vividas.c
index c99cbd1f6eb..350c7aa70a2 100644
--- a/chromium/third_party/ffmpeg/libavformat/vividas.c
+++ b/chromium/third_party/ffmpeg/libavformat/vividas.c
@@ -78,11 +78,11 @@ static int viv_probe(const AVProbeData *p)
return AVPROBE_SCORE_MAX;
}
-static const unsigned short keybits[32] = {
- 163, 416, 893, 82, 223, 572, 1137, 430,
- 659, 1104, 13, 626, 695, 972, 1465, 686,
- 843, 1216, 317, 1122, 1383, 92, 513, 1158,
- 1243, 48, 573, 1306, 1495, 396, 1009, 350,
+static const uint8_t keybits[32] = {
+ 20, 52, 111, 10, 27, 71, 142, 53,
+ 82, 138, 1, 78, 86, 121, 183, 85,
+105, 152, 39, 140, 172, 11, 64, 144,
+155, 6, 71, 163, 186, 49, 126, 43,
};
static uint32_t decode_key(uint8_t *buf)
@@ -91,7 +91,7 @@ static uint32_t decode_key(uint8_t *buf)
for (int i = 0; i < 32; i++) {
unsigned p = keybits[i];
- key |= !!(buf[p>>3] & (1<<(p&7))) << i;
+ key |= ((buf[p] >> ((i*5+3)&7)) & 1u) << i;
}
return key;
@@ -178,12 +178,13 @@ static void decode_block(uint8_t *src, uint8_t *dest, unsigned size,
}
}
-static uint32_t get_v(uint8_t *p)
+static uint32_t get_v(uint8_t *p, int len)
{
uint32_t v = 0;
+ const uint8_t *end = p + len;
do {
- if (v >= UINT_MAX / 128 - *p)
+ if (p >= end || v >= UINT_MAX / 128 - *p)
return v;
v <<= 7;
v += *p & 0x7f;
@@ -204,8 +205,8 @@ static uint8_t *read_vblock(AVIOContext *src, uint32_t *size,
decode_block(tmp, tmp, 4, key, k2, align);
- n = get_v(tmp);
- if (!n)
+ n = get_v(tmp, 4);
+ if (n < 4)
return NULL;
buf = av_malloc(n);
@@ -241,13 +242,13 @@ static uint8_t *read_sb_block(AVIOContext *src, unsigned *size,
k2 = *key;
decode_block(ibuf, sbuf, 8, *key, &k2, 0);
- n = get_v(sbuf+2);
+ n = get_v(sbuf+2, 6);
if (sbuf[0] != 'S' || sbuf[1] != 'B' || (expected_size>0 && n != expected_size)) {
uint32_t tmpkey = recover_key(ibuf, expected_size);
k2 = tmpkey;
decode_block(ibuf, sbuf, 8, tmpkey, &k2, 0);
- n = get_v(sbuf+2);
+ n = get_v(sbuf+2, 6);
if (sbuf[0] != 'S' || sbuf[1] != 'B' || expected_size != n)
return NULL;
*key = tmpkey;
diff --git a/chromium/third_party/ffmpeg/libavformat/vpk.c b/chromium/third_party/ffmpeg/libavformat/vpk.c
index 1dfb8fcd70b..255d6030b0d 100644
--- a/chromium/third_party/ffmpeg/libavformat/vpk.c
+++ b/chromium/third_party/ffmpeg/libavformat/vpk.c
@@ -56,16 +56,19 @@ static int vpk_read_header(AVFormatContext *s)
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX;
st->codecpar->block_align = avio_rl32(s->pb);
st->codecpar->sample_rate = avio_rl32(s->pb);
- if (st->codecpar->sample_rate <= 0)
+ if (st->codecpar->sample_rate <= 0 || st->codecpar->block_align <= 0)
return AVERROR_INVALIDDATA;
st->codecpar->channels = avio_rl32(s->pb);
if (st->codecpar->channels <= 0)
return AVERROR_INVALIDDATA;
- samples_per_block = ((st->codecpar->block_align / st->codecpar->channels) * 28) / 16;
+ samples_per_block = ((st->codecpar->block_align / st->codecpar->channels) * 28LL) / 16;
if (samples_per_block <= 0)
return AVERROR_INVALIDDATA;
vpk->block_count = (st->duration + (samples_per_block - 1)) / samples_per_block;
vpk->last_block_size = (st->duration % samples_per_block) * 16 * st->codecpar->channels / 28;
+
+ if (offset < avio_tell(s->pb))
+ return AVERROR_INVALIDDATA;
avio_skip(s->pb, offset - avio_tell(s->pb));
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
diff --git a/chromium/third_party/ffmpeg/libavformat/vqf.c b/chromium/third_party/ffmpeg/libavformat/vqf.c
index a58992318a1..755849bac74 100644
--- a/chromium/third_party/ffmpeg/libavformat/vqf.c
+++ b/chromium/third_party/ffmpeg/libavformat/vqf.c
@@ -107,6 +107,9 @@ static int vqf_read_header(AVFormatContext *s)
header_size = avio_rb32(s->pb);
+ if (header_size < 0)
+ return AVERROR_INVALIDDATA;
+
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->codec_id = AV_CODEC_ID_TWINVQ;
st->start_time = 0;
@@ -120,7 +123,7 @@ static int vqf_read_header(AVFormatContext *s)
len = avio_rb32(s->pb);
- if ((unsigned) len > INT_MAX/2) {
+ if ((unsigned) len > INT_MAX/2 || header_size < 8) {
av_log(s, AV_LOG_ERROR, "Malformed header\n");
return -1;
}
diff --git a/chromium/third_party/ffmpeg/libavformat/webm_chunk.c b/chromium/third_party/ffmpeg/libavformat/webm_chunk.c
index ec1ec4bf918..4e2ce21a797 100644
--- a/chromium/third_party/ffmpeg/libavformat/webm_chunk.c
+++ b/chromium/third_party/ffmpeg/libavformat/webm_chunk.c
@@ -52,7 +52,7 @@ typedef struct WebMChunkContext {
int chunk_index;
char *http_method;
uint64_t duration_written;
- int prev_pts;
+ int64_t prev_pts;
ff_const59 AVOutputFormat *oformat;
AVFormatContext *avf;
} WebMChunkContext;
@@ -84,7 +84,7 @@ static int chunk_mux_init(AVFormatContext *s)
return 0;
}
-static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename)
+static int get_chunk_filename(AVFormatContext *s, int is_header, char filename[MAX_FILENAME_SIZE])
{
WebMChunkContext *wc = s->priv_data;
AVFormatContext *oc = wc->avf;
@@ -92,11 +92,16 @@ static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename)
return AVERROR(EINVAL);
}
if (is_header) {
+ int len;
if (!wc->header_filename) {
av_log(oc, AV_LOG_ERROR, "No header filename provided\n");
return AVERROR(EINVAL);
}
- av_strlcpy(filename, wc->header_filename, strlen(wc->header_filename) + 1);
+ len = av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE);
+ if (len >= MAX_FILENAME_SIZE) {
+ av_log(oc, AV_LOG_ERROR, "Header filename too long\n");
+ return AVERROR(EINVAL);
+ }
} else {
if (av_get_frame_filename(filename, MAX_FILENAME_SIZE,
s->url, wc->chunk_index - 1) < 0) {
@@ -124,6 +129,7 @@ static int webm_chunk_write_header(AVFormatContext *s)
wc->oformat = av_guess_format("webm", s->url, "video/webm");
if (!wc->oformat)
return AVERROR_MUXER_NOT_FOUND;
+ wc->prev_pts = AV_NOPTS_VALUE;
ret = chunk_mux_init(s);
if (ret < 0)
@@ -168,7 +174,7 @@ static int chunk_start(AVFormatContext *s)
return 0;
}
-static int chunk_end(AVFormatContext *s)
+static int chunk_end(AVFormatContext *s, int flush)
{
WebMChunkContext *wc = s->priv_data;
AVFormatContext *oc = wc->avf;
@@ -179,11 +185,14 @@ static int chunk_end(AVFormatContext *s)
char filename[MAX_FILENAME_SIZE];
AVDictionary *options = NULL;
- if (wc->chunk_start_index == wc->chunk_index)
+ if (!oc->pb)
return 0;
- // Flush the cluster in WebM muxer.
- oc->oformat->write_packet(oc, NULL);
+
+ if (flush)
+ // Flush the cluster in WebM muxer.
+ oc->oformat->write_packet(oc, NULL);
buffer_size = avio_close_dyn_buf(oc->pb, &buffer);
+ oc->pb = NULL;
ret = get_chunk_filename(s, 0, filename);
if (ret < 0)
goto fail;
@@ -194,7 +203,6 @@ static int chunk_end(AVFormatContext *s)
goto fail;
avio_write(pb, buffer, buffer_size);
ff_format_io_close(s, &pb);
- oc->pb = NULL;
fail:
av_dict_free(&options);
av_free(buffer);
@@ -209,34 +217,27 @@ static int webm_chunk_write_packet(AVFormatContext *s, AVPacket *pkt)
int ret;
if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
- wc->duration_written += av_rescale_q(pkt->pts - wc->prev_pts,
- st->time_base,
- (AVRational) {1, 1000});
+ if (wc->prev_pts != AV_NOPTS_VALUE)
+ wc->duration_written += av_rescale_q(pkt->pts - wc->prev_pts,
+ st->time_base,
+ (AVRational) {1, 1000});
wc->prev_pts = pkt->pts;
}
// For video, a new chunk is started only on key frames. For audio, a new
- // chunk is started based on chunk_duration.
- if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
+ // chunk is started based on chunk_duration. Also, a new chunk is started
+ // unconditionally if there is no currently open chunk.
+ if (!oc->pb || (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
(pkt->flags & AV_PKT_FLAG_KEY)) ||
(st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
- (pkt->pts == 0 || wc->duration_written >= wc->chunk_duration))) {
+ wc->duration_written >= wc->chunk_duration)) {
wc->duration_written = 0;
- if ((ret = chunk_end(s)) < 0 || (ret = chunk_start(s)) < 0) {
- goto fail;
+ if ((ret = chunk_end(s, 1)) < 0 || (ret = chunk_start(s)) < 0) {
+ return ret;
}
}
ret = oc->oformat->write_packet(oc, pkt);
- if (ret < 0)
- goto fail;
-
-fail:
- if (ret < 0) {
- oc->streams = NULL;
- oc->nb_streams = 0;
- avformat_free_context(oc);
- }
return ret;
}
@@ -245,12 +246,20 @@ static int webm_chunk_write_trailer(AVFormatContext *s)
{
WebMChunkContext *wc = s->priv_data;
AVFormatContext *oc = wc->avf;
+ int ret;
+
+ if (!oc->pb) {
+ ret = chunk_start(s);
+ if (ret < 0)
+ goto fail;
+ }
oc->oformat->write_trailer(oc);
- chunk_end(s);
+ ret = chunk_end(s, 0);
+fail:
oc->streams = NULL;
oc->nb_streams = 0;
avformat_free_context(oc);
- return 0;
+ return ret;
}
#define OFFSET(x) offsetof(WebMChunkContext, x)
diff --git a/chromium/third_party/ffmpeg/libavformat/webvttdec.c b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
index e435de36c70..52579c5ed2c 100644
--- a/chromium/third_party/ffmpeg/libavformat/webvttdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/webvttdec.c
@@ -192,14 +192,14 @@ static int webvtt_read_close(AVFormatContext *s)
}
#define OFFSET(x) offsetof(WebVTTContext, x)
-#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM
+#define KIND_FLAGS AV_OPT_FLAG_SUBTITLE_PARAM|AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
{ "kind", "Set kind of WebVTT track", OFFSET(kind), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, KIND_FLAGS, "webvtt_kind" },
- { "subtitles", "WebVTT subtitles kind", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
- { "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
- { "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
- { "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, 0, "webvtt_kind" },
+ { "subtitles", "WebVTT subtitles kind", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, KIND_FLAGS, "webvtt_kind" },
+ { "captions", "WebVTT captions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, "webvtt_kind" },
+ { "descriptions", "WebVTT descriptions kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, INT_MIN, INT_MAX, KIND_FLAGS, "webvtt_kind" },
+ { "metadata", "WebVTT metadata kind", 0, AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, INT_MIN, INT_MAX, KIND_FLAGS, "webvtt_kind" },
{ NULL }
};
diff --git a/chromium/third_party/ffmpeg/libavformat/wsddec.c b/chromium/third_party/ffmpeg/libavformat/wsddec.c
index dfa8014b1c6..574addf6207 100644
--- a/chromium/third_party/ffmpeg/libavformat/wsddec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wsddec.c
@@ -137,7 +137,7 @@ static int wsd_read_header(AVFormatContext *s)
if (!(channel_assign & 1)) {
int i;
for (i = 1; i < 32; i++)
- if (channel_assign & (1 << i))
+ if ((channel_assign >> i) & 1)
st->codecpar->channel_layout |= wsd_to_av_channel_layoyt(s, i);
}
diff --git a/chromium/third_party/ffmpeg/libavformat/wtvdec.c b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
index 890db2e705a..706e8ca38dd 100644
--- a/chromium/third_party/ffmpeg/libavformat/wtvdec.c
+++ b/chromium/third_party/ffmpeg/libavformat/wtvdec.c
@@ -149,7 +149,7 @@ static int read_ints(AVIOContext *pb, uint32_t *data, int count)
* @param depth File allocation table depth
* @return NULL on error
*/
-static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
+static AVIOContext * wtvfile_open_sector(unsigned first_sector, uint64_t length, int depth, AVFormatContext *s)
{
AVIOContext *pb;
WtvFile *wf;
@@ -957,7 +957,8 @@ static int parse_chunks(AVFormatContext *s, int mode, int64_t seekts, int *len_p
static int read_header(AVFormatContext *s)
{
WtvContext *wtv = s->priv_data;
- int root_sector, root_size;
+ unsigned root_sector;
+ int root_size;
uint8_t root[WTV_SECTOR_SIZE];
AVIOContext *pb;
int64_t timeline_pos;
diff --git a/chromium/third_party/ffmpeg/libavutil/Makefile b/chromium/third_party/ffmpeg/libavutil/Makefile
index 53208fc5877..8a7a44e4b5e 100644
--- a/chromium/third_party/ffmpeg/libavutil/Makefile
+++ b/chromium/third_party/ffmpeg/libavutil/Makefile
@@ -79,6 +79,7 @@ HEADERS = adler32.h \
version.h \
xtea.h \
tea.h \
+ tx.h \
HEADERS-$(CONFIG_LZO) += lzo.h
@@ -159,6 +160,7 @@ OBJS = adler32.o \
xga_font_data.o \
xtea.o \
tea.o \
+ tx.o \
OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
OBJS-$(CONFIG_D3D11VA) += hwcontext_d3d11va.o
diff --git a/chromium/third_party/ffmpeg/libavutil/avstring.c b/chromium/third_party/ffmpeg/libavutil/avstring.c
index f03dd251417..4c068f5bc57 100644
--- a/chromium/third_party/ffmpeg/libavutil/avstring.c
+++ b/chromium/third_party/ffmpeg/libavutil/avstring.c
@@ -222,12 +222,13 @@ int av_strcasecmp(const char *a, const char *b)
int av_strncasecmp(const char *a, const char *b, size_t n)
{
- const char *end = a + n;
uint8_t c1, c2;
+ if (n <= 0)
+ return 0;
do {
c1 = av_tolower(*a++);
c2 = av_tolower(*b++);
- } while (a < end && c1 && c1 == c2);
+ } while (--n && c1 && c1 == c2);
return c1 - c2;
}
diff --git a/chromium/third_party/ffmpeg/libavutil/dynarray.h b/chromium/third_party/ffmpeg/libavutil/dynarray.h
index 034a9fedfef..3a7e146422a 100644
--- a/chromium/third_party/ffmpeg/libavutil/dynarray.h
+++ b/chromium/third_party/ffmpeg/libavutil/dynarray.h
@@ -23,7 +23,7 @@
#include "mem.h"
/**
- * Add an element of to a dynamic array.
+ * Add an element 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.
diff --git a/chromium/third_party/ffmpeg/libavutil/frame.h b/chromium/third_party/ffmpeg/libavutil/frame.h
index 8aa3e88367a..5d3231e7bb6 100644
--- a/chromium/third_party/ffmpeg/libavutil/frame.h
+++ b/chromium/third_party/ffmpeg/libavutil/frame.h
@@ -207,31 +207,58 @@ typedef struct AVFrameSideData {
} AVFrameSideData;
/**
- * Structure to hold Region Of Interest.
+ * Structure describing a single Region Of Interest.
*
- * self_size specifies the size of this data structure. This value
- * should be set to sizeof(AVRegionOfInterest). EINVAL is returned if self_size is zero.
+ * When multiple regions are defined in a single side-data block, they
+ * should be ordered from most to least important - some encoders are only
+ * capable of supporting a limited number of distinct regions, so will have
+ * to truncate the list.
*
- * Number of pixels to discard from the top/bottom/left/right border of
- * the frame to obtain the region of interest of the frame.
- * They are encoder dependent and will be extended internally
- * if the codec requires an alignment.
- * If the regions overlap, the last value in the list will be used.
- *
- * qoffset is quant offset, and base rule here:
- * returns EINVAL if AVRational.den is zero.
- * the value (num/den) range is [-1.0, 1.0], clamp to +-1.0 if out of range.
- * 0 means no picture quality change,
- * negative offset asks for better quality (and the best with value -1.0),
- * positive offset asks for worse quality (and the worst with value 1.0).
- * How to explain/implement the different quilaity requirement is encoder dependent.
+ * When overlapping regions are defined, the first region containing a given
+ * area of the frame applies.
*/
typedef struct AVRegionOfInterest {
+ /**
+ * Must be set to the size of this data structure (that is,
+ * sizeof(AVRegionOfInterest)).
+ */
uint32_t self_size;
+ /**
+ * Distance in pixels from the top edge of the frame to the top and
+ * bottom edges and from the left edge of the frame to the left and
+ * right edges of the rectangle defining this region of interest.
+ *
+ * The constraints on a region are encoder dependent, so the region
+ * actually affected may be slightly larger for alignment or other
+ * reasons.
+ */
int top;
int bottom;
int left;
int right;
+ /**
+ * Quantisation offset.
+ *
+ * Must be in the range -1 to +1. A value of zero indicates no quality
+ * change. A negative value asks for better quality (less quantisation),
+ * while a positive value asks for worse quality (greater quantisation).
+ *
+ * The range is calibrated so that the extreme values indicate the
+ * largest possible offset - if the rest of the frame is encoded with the
+ * worst possible quality, an offset of -1 indicates that this region
+ * should be encoded with the best possible quality anyway. Intermediate
+ * values are then interpolated in some codec-dependent way.
+ *
+ * For example, in 10-bit H.264 the quantisation parameter varies between
+ * -12 and 51. A typical qoffset value of -1/10 therefore indicates that
+ * this region should be encoded with a QP around one-tenth of the full
+ * range better than the rest of the frame. So, if most of the frame
+ * were to be encoded with a QP of around 30, this region would get a QP
+ * of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
+ * An extreme value of -1 would indicate that this region should be
+ * encoded with the best possible quality regardless of the treatment of
+ * the rest of the frame - that is, should be encoded at a QP of -12.
+ */
AVRational qoffset;
} AVRegionOfInterest;
@@ -563,6 +590,8 @@ typedef struct AVFrame {
int decode_error_flags;
#define FF_DECODE_ERROR_INVALID_BITSTREAM 1
#define FF_DECODE_ERROR_MISSING_REFERENCE 2
+#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
+#define FF_DECODE_ERROR_DECODE_SLICES 8
/**
* number of audio channels, only used for audio.
diff --git a/chromium/third_party/ffmpeg/libavutil/hwcontext_qsv.c b/chromium/third_party/ffmpeg/libavutil/hwcontext_qsv.c
index 8f9838d7d81..59e4ed91571 100644
--- a/chromium/third_party/ffmpeg/libavutil/hwcontext_qsv.c
+++ b/chromium/third_party/ffmpeg/libavutil/hwcontext_qsv.c
@@ -892,8 +892,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
if (ret < 0)
return ret;
-
- if (src->height & 16 || src->linesize[0] & 16) {
+ if (src->height & 15 || src->linesize[0] & 15) {
realigned = 1;
memset(&tmp_frame, 0, sizeof(tmp_frame));
tmp_frame.format = src->format;
@@ -1207,6 +1206,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
QSVDevicePriv *priv;
enum AVHWDeviceType child_device_type;
AVHWDeviceContext *child_device;
+ AVDictionary *child_device_opts;
AVDictionaryEntry *e;
mfxIMPL impl;
@@ -1221,9 +1221,17 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
e = av_dict_get(opts, "child_device", NULL, 0);
- if (CONFIG_VAAPI)
+ child_device_opts = NULL;
+ if (CONFIG_VAAPI) {
child_device_type = AV_HWDEVICE_TYPE_VAAPI;
- else if (CONFIG_DXVA2)
+ // libmfx does not actually implement VAAPI properly, rather it
+ // depends on the specific behaviour of a matching iHD driver when
+ // used on recent Intel hardware. Set options to the VAAPI device
+ // creation so that we should pick a usable setup by default if
+ // possible, even when multiple devices and drivers are available.
+ av_dict_set(&child_device_opts, "kernel_driver", "i915", 0);
+ av_dict_set(&child_device_opts, "driver", "iHD", 0);
+ } else if (CONFIG_DXVA2)
child_device_type = AV_HWDEVICE_TYPE_DXVA2;
else {
av_log(ctx, AV_LOG_ERROR, "No supported child device type is enabled\n");
@@ -1231,7 +1239,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device,
}
ret = av_hwdevice_ctx_create(&priv->child_device_ctx, child_device_type,
- e ? e->value : NULL, NULL, 0);
+ e ? e->value : NULL, child_device_opts, 0);
if (ret < 0)
return ret;
diff --git a/chromium/third_party/ffmpeg/libavutil/hwcontext_vaapi.c b/chromium/third_party/ffmpeg/libavutil/hwcontext_vaapi.c
index 8624369bb9f..cf117640f28 100644
--- a/chromium/third_party/ffmpeg/libavutil/hwcontext_vaapi.c
+++ b/chromium/third_party/ffmpeg/libavutil/hwcontext_vaapi.c
@@ -27,6 +27,7 @@
#if CONFIG_LIBDRM
# include <va/va_drmcommon.h>
+# include <xf86drm.h>
# include <drm_fourcc.h>
# ifndef DRM_FORMAT_MOD_INVALID
# define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
@@ -1469,6 +1470,8 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
{
VAAPIDevicePriv *priv;
VADisplay display = NULL;
+ const AVDictionaryEntry *ent;
+ int try_drm, try_x11, try_all;
priv = av_mallocz(sizeof(*priv));
if (!priv)
@@ -1479,8 +1482,95 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
ctx->user_opaque = priv;
ctx->free = vaapi_device_free;
+ ent = av_dict_get(opts, "connection_type", NULL, 0);
+ if (ent) {
+ try_all = try_drm = try_x11 = 0;
+ if (!strcmp(ent->value, "drm")) {
+ try_drm = 1;
+ } else if (!strcmp(ent->value, "x11")) {
+ try_x11 = 1;
+ } else {
+ av_log(ctx, AV_LOG_ERROR, "Invalid connection type %s.\n",
+ ent->value);
+ return AVERROR(EINVAL);
+ }
+ } else {
+ try_all = 1;
+ try_drm = HAVE_VAAPI_DRM;
+ try_x11 = HAVE_VAAPI_X11;
+ }
+
+#if HAVE_VAAPI_DRM
+ while (!display && try_drm) {
+ // If the device is specified, try to open it as a DRM device node.
+ // If not, look for a usable render node, possibly restricted to those
+ // using a specified kernel driver.
+ int loglevel = try_all ? AV_LOG_VERBOSE : AV_LOG_ERROR;
+ if (device) {
+ priv->drm_fd = open(device, O_RDWR);
+ if (priv->drm_fd < 0) {
+ av_log(ctx, loglevel, "Failed to open %s as "
+ "DRM device node.\n", device);
+ break;
+ }
+ } else {
+ char path[64];
+ int n, max_devices = 8;
+#if CONFIG_LIBDRM
+ const AVDictionaryEntry *kernel_driver;
+ kernel_driver = av_dict_get(opts, "kernel_driver", NULL, 0);
+#endif
+ for (n = 0; n < max_devices; n++) {
+ snprintf(path, sizeof(path),
+ "/dev/dri/renderD%d", 128 + n);
+ priv->drm_fd = open(path, O_RDWR);
+ if (priv->drm_fd < 0) {
+ av_log(ctx, AV_LOG_VERBOSE, "Cannot open "
+ "DRM render node for device %d.\n", n);
+ break;
+ }
+#if CONFIG_LIBDRM
+ if (kernel_driver) {
+ drmVersion *info;
+ info = drmGetVersion(priv->drm_fd);
+ if (strcmp(kernel_driver->value, info->name)) {
+ av_log(ctx, AV_LOG_VERBOSE, "Ignoring device %d "
+ "with non-matching kernel driver (%s).\n",
+ n, info->name);
+ drmFreeVersion(info);
+ close(priv->drm_fd);
+ priv->drm_fd = -1;
+ continue;
+ }
+ av_log(ctx, AV_LOG_VERBOSE, "Trying to use "
+ "DRM render node for device %d, "
+ "with matching kernel driver (%s).\n",
+ n, info->name);
+ drmFreeVersion(info);
+ } else
+#endif
+ {
+ av_log(ctx, AV_LOG_VERBOSE, "Trying to use "
+ "DRM render node for device %d.\n", n);
+ }
+ break;
+ }
+ if (n >= max_devices)
+ break;
+ }
+
+ display = vaGetDisplayDRM(priv->drm_fd);
+ if (!display) {
+ av_log(ctx, AV_LOG_VERBOSE, "Cannot open a VA display "
+ "from DRM device %s.\n", device);
+ return AVERROR_EXTERNAL;
+ }
+ break;
+ }
+#endif
+
#if HAVE_VAAPI_X11
- if (!display && !(device && device[0] == '/')) {
+ if (!display && try_x11) {
// Try to open the device as an X11 display.
priv->x11_display = XOpenDisplay(device);
if (!priv->x11_display) {
@@ -1500,34 +1590,31 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
}
#endif
-#if HAVE_VAAPI_DRM
if (!display) {
- // Try to open the device as a DRM path.
- // Default to using the first render node if the user did not
- // supply a path.
- const char *path = device ? device : "/dev/dri/renderD128";
- priv->drm_fd = open(path, O_RDWR);
- if (priv->drm_fd < 0) {
- av_log(ctx, AV_LOG_VERBOSE, "Cannot open DRM device %s.\n",
- path);
- } else {
- display = vaGetDisplayDRM(priv->drm_fd);
- if (!display) {
- av_log(ctx, AV_LOG_ERROR, "Cannot open a VA display "
- "from DRM device %s.\n", path);
- return AVERROR_UNKNOWN;
- }
+ if (device)
+ av_log(ctx, AV_LOG_ERROR, "No VA display found for "
+ "device %s.\n", device);
+ else
+ av_log(ctx, AV_LOG_ERROR, "No VA display found for "
+ "any default device.\n");
+ return AVERROR(EINVAL);
+ }
- av_log(ctx, AV_LOG_VERBOSE, "Opened VA display via "
- "DRM device %s.\n", path);
+ ent = av_dict_get(opts, "driver", NULL, 0);
+ if (ent) {
+#if VA_CHECK_VERSION(0, 38, 0)
+ VAStatus vas;
+ vas = vaSetDriverName(display, ent->value);
+ if (vas != VA_STATUS_SUCCESS) {
+ av_log(ctx, AV_LOG_ERROR, "Failed to set driver name to "
+ "%s: %d (%s).\n", ent->value, vas, vaErrorStr(vas));
+ vaTerminate(display);
+ return AVERROR_EXTERNAL;
}
- }
+#else
+ av_log(ctx, AV_LOG_WARNING, "Driver name setting is not "
+ "supported with this VAAPI version.\n");
#endif
-
- if (!display) {
- av_log(ctx, AV_LOG_ERROR, "No VA display found for "
- "device: %s.\n", device ? device : "");
- return AVERROR(EINVAL);
}
return vaapi_device_connect(ctx, display);
diff --git a/chromium/third_party/ffmpeg/libavutil/hwcontext_vdpau.c b/chromium/third_party/ffmpeg/libavutil/hwcontext_vdpau.c
index c11c3cfdab2..6b8c1d5f767 100644
--- a/chromium/third_party/ffmpeg/libavutil/hwcontext_vdpau.c
+++ b/chromium/third_party/ffmpeg/libavutil/hwcontext_vdpau.c
@@ -73,8 +73,10 @@ static const VDPAUPixFmtMap pix_fmts_422[] = {
};
static const VDPAUPixFmtMap pix_fmts_444[] = {
- { VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV444P },
- { 0, AV_PIX_FMT_NONE, },
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ { VDP_YCBCR_FORMAT_Y_U_V_444, AV_PIX_FMT_YUV444P },
+#endif
+ { 0, AV_PIX_FMT_NONE, },
};
static const struct {
@@ -349,7 +351,11 @@ static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
return AVERROR(EINVAL);
}
- if (vdpau_format == VDP_YCBCR_FORMAT_YV12)
+ if ((vdpau_format == VDP_YCBCR_FORMAT_YV12)
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ || (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444)
+#endif
+ )
FFSWAP(void*, data[1], data[2]);
err = priv->get_data(surf, vdpau_format, data, linesize);
@@ -400,7 +406,11 @@ static int vdpau_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
return AVERROR(EINVAL);
}
- if (vdpau_format == VDP_YCBCR_FORMAT_YV12)
+ if ((vdpau_format == VDP_YCBCR_FORMAT_YV12)
+#ifdef VDP_YCBCR_FORMAT_Y_U_V_444
+ || (vdpau_format == VDP_YCBCR_FORMAT_Y_U_V_444)
+#endif
+ )
FFSWAP(const void*, data[1], data[2]);
err = priv->put_data(surf, vdpau_format, data, linesize);
diff --git a/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h b/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
index 6a467046631..a3774281f9e 100644
--- a/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
+++ b/chromium/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
@@ -23,6 +23,11 @@
#include <stdint.h>
#include <msa.h>
+#include <config.h>
+
+#if HAVE_MSA2
+#include <msa2.h>
+#endif
#define ALIGNMENT 16
#define ALLOC_ALIGNED(align) __attribute__ ((aligned((align) << 1)))
@@ -1234,6 +1239,15 @@
unsigned absolute diff values, even-odd pairs are added
together to generate 8 halfword results.
*/
+#if HAVE_MSA2
+#define SAD_UB2_UH(in0, in1, ref0, ref1) \
+( { \
+ v8u16 sad_m = { 0 }; \
+ sad_m += __builtin_msa2_sad_adj2_u_w2x_b((v16u8) in0, (v16u8) ref0); \
+ sad_m += __builtin_msa2_sad_adj2_u_w2x_b((v16u8) in1, (v16u8) ref1); \
+ sad_m; \
+} )
+#else
#define SAD_UB2_UH(in0, in1, ref0, ref1) \
( { \
v16u8 diff0_m, diff1_m; \
@@ -1247,6 +1261,7 @@
\
sad_m; \
} )
+#endif // #if HAVE_MSA2
/* Description : Insert specified word elements from input vectors to 1
destination vector
@@ -2287,6 +2302,12 @@
extracted and interleaved with same vector 'in0' to generate
4 word elements keeping sign intact
*/
+#if HAVE_MSA2
+#define UNPCK_R_SH_SW(in, out) \
+{ \
+ out = (v4i32) __builtin_msa2_w2x_lo_s_h((v8i16) in); \
+}
+#else
#define UNPCK_R_SH_SW(in, out) \
{ \
v8i16 sign_m; \
@@ -2294,6 +2315,7 @@
sign_m = __msa_clti_s_h((v8i16) in, 0); \
out = (v4i32) __msa_ilvr_h(sign_m, (v8i16) in); \
}
+#endif // #if HAVE_MSA2
/* Description : Sign extend byte elements from input vector and return
halfword results in pair of vectors
@@ -2306,6 +2328,13 @@
Then interleaved left with same vector 'in0' to
generate 8 signed halfword elements in 'out1'
*/
+#if HAVE_MSA2
+#define UNPCK_SB_SH(in, out0, out1) \
+{ \
+ out0 = (v4i32) __builtin_msa2_w2x_lo_s_b((v16i8) in); \
+ out1 = (v4i32) __builtin_msa2_w2x_hi_s_b((v16i8) in); \
+}
+#else
#define UNPCK_SB_SH(in, out0, out1) \
{ \
v16i8 tmp_m; \
@@ -2313,6 +2342,7 @@
tmp_m = __msa_clti_s_b((v16i8) in, 0); \
ILVRL_B2_SH(tmp_m, in, out0, out1); \
}
+#endif // #if HAVE_MSA2
/* Description : Zero extend unsigned byte elements to halfword elements
Arguments : Inputs - in (1 input unsigned byte vector)
@@ -2339,6 +2369,13 @@
Then interleaved left with same vector 'in0' to
generate 4 signed word elements in 'out1'
*/
+#if HAVE_MSA2
+#define UNPCK_SH_SW(in, out0, out1) \
+{ \
+ out0 = (v4i32) __builtin_msa2_w2x_lo_s_h((v8i16) in); \
+ out1 = (v4i32) __builtin_msa2_w2x_hi_s_h((v8i16) in); \
+}
+#else
#define UNPCK_SH_SW(in, out0, out1) \
{ \
v8i16 tmp_m; \
@@ -2346,6 +2383,7 @@
tmp_m = __msa_clti_s_h((v8i16) in, 0); \
ILVRL_H2_SW(tmp_m, in, out0, out1); \
}
+#endif // #if HAVE_MSA2
/* Description : Swap two variables
Arguments : Inputs - in0, in1
@@ -2850,13 +2888,11 @@
*/
#define DPADD_SH3_SH(in0, in1, in2, coeff0, coeff1, coeff2) \
( { \
- v8i16 tmp1_m; \
v8i16 out0_m; \
\
out0_m = __msa_dotp_s_h((v16i8) in0, (v16i8) coeff0); \
out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in1, (v16i8) coeff1); \
- tmp1_m = __msa_dotp_s_h((v16i8) in2, (v16i8) coeff2); \
- out0_m = __msa_adds_s_h(out0_m, tmp1_m); \
+ out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in2, (v16i8) coeff2); \
\
out0_m; \
} )
diff --git a/chromium/third_party/ffmpeg/libavutil/pixdesc.c b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
index fe38344d732..b97b0665b0a 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixdesc.c
+++ b/chromium/third_party/ffmpeg/libavutil/pixdesc.c
@@ -2320,6 +2320,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
},
.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
},
+ [AV_PIX_FMT_NV24] = {
+ .name = "nv24",
+ .nb_components = 3,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 2, 0, 0, 8, 1, 7, 1 }, /* U */
+ { 1, 2, 1, 0, 8, 1, 7, 2 }, /* V */
+ },
+ .flags = AV_PIX_FMT_FLAG_PLANAR,
+ },
+ [AV_PIX_FMT_NV42] = {
+ .name = "nv42",
+ .nb_components = 3,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 1, 0, 0, 8, 0, 7, 1 }, /* Y */
+ { 1, 2, 1, 0, 8, 1, 7, 2 }, /* U */
+ { 1, 2, 0, 0, 8, 1, 7, 1 }, /* V */
+ },
+ .flags = AV_PIX_FMT_FLAG_PLANAR,
+ },
};
#if FF_API_PLUS1_MINUS1
FF_ENABLE_DEPRECATION_WARNINGS
diff --git a/chromium/third_party/ffmpeg/libavutil/pixfmt.h b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
index 24d1b7e4153..8b54c9415bb 100644
--- a/chromium/third_party/ffmpeg/libavutil/pixfmt.h
+++ b/chromium/third_party/ffmpeg/libavutil/pixfmt.h
@@ -345,6 +345,9 @@ enum AVPixelFormat {
AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian
+ AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+ AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped
+
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
};
diff --git a/chromium/third_party/ffmpeg/libavutil/time_internal.h b/chromium/third_party/ffmpeg/libavutil/time_internal.h
index 612a75a0411..d0f007ab1c4 100644
--- a/chromium/third_party/ffmpeg/libavutil/time_internal.h
+++ b/chromium/third_party/ffmpeg/libavutil/time_internal.h
@@ -23,7 +23,7 @@
#include "config.h"
#if !HAVE_GMTIME_R && !defined(gmtime_r)
-static inline struct tm *gmtime_r(const time_t* clock, struct tm *result)
+static inline struct tm *ff_gmtime_r(const time_t* clock, struct tm *result)
{
struct tm *ptr = gmtime(clock);
if (!ptr)
@@ -31,10 +31,11 @@ static inline struct tm *gmtime_r(const time_t* clock, struct tm *result)
*result = *ptr;
return result;
}
+#define gmtime_r ff_gmtime_r
#endif
#if !HAVE_LOCALTIME_R && !defined(localtime_r)
-static inline struct tm *localtime_r(const time_t* clock, struct tm *result)
+static inline struct tm *ff_localtime_r(const time_t* clock, struct tm *result)
{
struct tm *ptr = localtime(clock);
if (!ptr)
@@ -42,6 +43,7 @@ static inline struct tm *localtime_r(const time_t* clock, struct tm *result)
*result = *ptr;
return result;
}
+#define localtime_r ff_localtime_r
#endif
#endif /* AVUTIL_TIME_INTERNAL_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/tx.c b/chromium/third_party/ffmpeg/libavutil/tx.c
new file mode 100644
index 00000000000..93f6e489d36
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/tx.c
@@ -0,0 +1,803 @@
+/*
+ * Copyright (c) 2019 Lynne <dev@lynne.ee>
+ * Power of two FFT:
+ * Copyright (c) 2008 Loren Merritt
+ * Copyright (c) 2002 Fabrice Bellard
+ * Partly 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 <stddef.h>
+#include "tx.h"
+#include "thread.h"
+#include "mem.h"
+#include "avassert.h"
+
+typedef float FFTSample;
+typedef AVComplexFloat FFTComplex;
+
+struct AVTXContext {
+ int n; /* Nptwo part */
+ int m; /* Ptwo part */
+
+ FFTComplex *exptab; /* MDCT exptab */
+ FFTComplex *tmp; /* Temporary buffer needed for all compound transforms */
+ int *pfatab; /* Input/Output mapping for compound transforms */
+ int *revtab; /* Input mapping for power of two transforms */
+};
+
+#define FFT_NAME(x) x
+
+#define COSTABLE(size) \
+ static DECLARE_ALIGNED(32, FFTSample, FFT_NAME(ff_cos_##size))[size/2]
+
+static FFTSample * const FFT_NAME(ff_cos_tabs)[18];
+
+COSTABLE(16);
+COSTABLE(32);
+COSTABLE(64);
+COSTABLE(128);
+COSTABLE(256);
+COSTABLE(512);
+COSTABLE(1024);
+COSTABLE(2048);
+COSTABLE(4096);
+COSTABLE(8192);
+COSTABLE(16384);
+COSTABLE(32768);
+COSTABLE(65536);
+COSTABLE(131072);
+
+static av_cold void init_ff_cos_tabs(int index)
+{
+ int m = 1 << index;
+ double freq = 2*M_PI/m;
+ FFTSample *tab = FFT_NAME(ff_cos_tabs)[index];
+ for(int i = 0; i <= m/4; i++)
+ tab[i] = cos(i*freq);
+ for(int i = 1; i < m/4; i++)
+ tab[m/2 - i] = tab[i];
+}
+
+typedef struct CosTabsInitOnce {
+ void (*func)(void);
+ AVOnce control;
+} CosTabsInitOnce;
+
+#define INIT_FF_COS_TABS_FUNC(index, size) \
+static av_cold void init_ff_cos_tabs_ ## size (void) \
+{ \
+ init_ff_cos_tabs(index); \
+}
+
+INIT_FF_COS_TABS_FUNC(4, 16)
+INIT_FF_COS_TABS_FUNC(5, 32)
+INIT_FF_COS_TABS_FUNC(6, 64)
+INIT_FF_COS_TABS_FUNC(7, 128)
+INIT_FF_COS_TABS_FUNC(8, 256)
+INIT_FF_COS_TABS_FUNC(9, 512)
+INIT_FF_COS_TABS_FUNC(10, 1024)
+INIT_FF_COS_TABS_FUNC(11, 2048)
+INIT_FF_COS_TABS_FUNC(12, 4096)
+INIT_FF_COS_TABS_FUNC(13, 8192)
+INIT_FF_COS_TABS_FUNC(14, 16384)
+INIT_FF_COS_TABS_FUNC(15, 32768)
+INIT_FF_COS_TABS_FUNC(16, 65536)
+INIT_FF_COS_TABS_FUNC(17, 131072)
+
+static CosTabsInitOnce cos_tabs_init_once[] = {
+ { NULL },
+ { NULL },
+ { NULL },
+ { NULL },
+ { init_ff_cos_tabs_16, AV_ONCE_INIT },
+ { init_ff_cos_tabs_32, AV_ONCE_INIT },
+ { init_ff_cos_tabs_64, AV_ONCE_INIT },
+ { init_ff_cos_tabs_128, AV_ONCE_INIT },
+ { init_ff_cos_tabs_256, AV_ONCE_INIT },
+ { init_ff_cos_tabs_512, AV_ONCE_INIT },
+ { init_ff_cos_tabs_1024, AV_ONCE_INIT },
+ { init_ff_cos_tabs_2048, AV_ONCE_INIT },
+ { init_ff_cos_tabs_4096, AV_ONCE_INIT },
+ { init_ff_cos_tabs_8192, AV_ONCE_INIT },
+ { init_ff_cos_tabs_16384, AV_ONCE_INIT },
+ { init_ff_cos_tabs_32768, AV_ONCE_INIT },
+ { init_ff_cos_tabs_65536, AV_ONCE_INIT },
+ { init_ff_cos_tabs_131072, AV_ONCE_INIT },
+};
+
+static FFTSample * const FFT_NAME(ff_cos_tabs)[] = {
+ NULL, NULL, NULL, NULL,
+ FFT_NAME(ff_cos_16),
+ FFT_NAME(ff_cos_32),
+ FFT_NAME(ff_cos_64),
+ FFT_NAME(ff_cos_128),
+ FFT_NAME(ff_cos_256),
+ FFT_NAME(ff_cos_512),
+ FFT_NAME(ff_cos_1024),
+ FFT_NAME(ff_cos_2048),
+ FFT_NAME(ff_cos_4096),
+ FFT_NAME(ff_cos_8192),
+ FFT_NAME(ff_cos_16384),
+ FFT_NAME(ff_cos_32768),
+ FFT_NAME(ff_cos_65536),
+ FFT_NAME(ff_cos_131072),
+};
+
+static av_cold void ff_init_ff_cos_tabs(int index)
+{
+ ff_thread_once(&cos_tabs_init_once[index].control,
+ cos_tabs_init_once[index].func);
+}
+
+static AVOnce tabs_53_once = AV_ONCE_INIT;
+static DECLARE_ALIGNED(32, FFTComplex, FFT_NAME(ff_53_tabs))[4];
+
+static av_cold void ff_init_53_tabs(void)
+{
+ ff_53_tabs[0] = (FFTComplex){ cos(2 * M_PI / 12), cos(2 * M_PI / 12) };
+ ff_53_tabs[1] = (FFTComplex){ 0.5, 0.5 };
+ ff_53_tabs[2] = (FFTComplex){ cos(2 * M_PI / 5), sin(2 * M_PI / 5) };
+ ff_53_tabs[3] = (FFTComplex){ cos(2 * M_PI / 10), sin(2 * M_PI / 10) };
+}
+
+#define BF(x, y, a, b) do { \
+ x = (a) - (b); \
+ y = (a) + (b); \
+ } while (0)
+
+#define CMUL(dre, dim, are, aim, bre, bim) do { \
+ (dre) = (are) * (bre) - (aim) * (bim); \
+ (dim) = (are) * (bim) + (aim) * (bre); \
+ } while (0)
+
+#define CMUL3(c, a, b) CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
+
+static av_always_inline void fft3(FFTComplex *out, FFTComplex *in,
+ ptrdiff_t stride)
+{
+ FFTComplex tmp[2];
+
+ tmp[0].re = in[1].im - in[2].im;
+ tmp[0].im = in[1].re - in[2].re;
+ tmp[1].re = in[1].re + in[2].re;
+ tmp[1].im = in[1].im + in[2].im;
+
+ out[0*stride].re = in[0].re + tmp[1].re;
+ out[0*stride].im = in[0].im + tmp[1].im;
+
+ tmp[0].re *= ff_53_tabs[0].re;
+ tmp[0].im *= ff_53_tabs[0].im;
+ tmp[1].re *= ff_53_tabs[1].re;
+ tmp[1].im *= ff_53_tabs[1].re;
+
+ out[1*stride].re = in[0].re - tmp[1].re + tmp[0].re;
+ out[1*stride].im = in[0].im - tmp[1].im - tmp[0].im;
+ out[2*stride].re = in[0].re - tmp[1].re - tmp[0].re;
+ out[2*stride].im = in[0].im - tmp[1].im + tmp[0].im;
+}
+
+#define DECL_FFT5(NAME, D0, D1, D2, D3, D4) \
+static av_always_inline void NAME(FFTComplex *out, FFTComplex *in, \
+ ptrdiff_t stride) \
+{ \
+ FFTComplex z0[4], t[6]; \
+ \
+ t[0].re = in[1].re + in[4].re; \
+ t[0].im = in[1].im + in[4].im; \
+ t[1].im = in[1].re - in[4].re; \
+ t[1].re = in[1].im - in[4].im; \
+ t[2].re = in[2].re + in[3].re; \
+ t[2].im = in[2].im + in[3].im; \
+ t[3].im = in[2].re - in[3].re; \
+ t[3].re = in[2].im - in[3].im; \
+ \
+ out[D0*stride].re = in[0].re + in[1].re + in[2].re + \
+ in[3].re + in[4].re; \
+ out[D0*stride].im = in[0].im + in[1].im + in[2].im + \
+ in[3].im + in[4].im; \
+ \
+ t[4].re = ff_53_tabs[2].re * t[2].re - ff_53_tabs[3].re * t[0].re; \
+ t[4].im = ff_53_tabs[2].re * t[2].im - ff_53_tabs[3].re * t[0].im; \
+ t[0].re = ff_53_tabs[2].re * t[0].re - ff_53_tabs[3].re * t[2].re; \
+ t[0].im = ff_53_tabs[2].re * t[0].im - ff_53_tabs[3].re * t[2].im; \
+ t[5].re = ff_53_tabs[2].im * t[3].re - ff_53_tabs[3].im * t[1].re; \
+ t[5].im = ff_53_tabs[2].im * t[3].im - ff_53_tabs[3].im * t[1].im; \
+ t[1].re = ff_53_tabs[2].im * t[1].re + ff_53_tabs[3].im * t[3].re; \
+ t[1].im = ff_53_tabs[2].im * t[1].im + ff_53_tabs[3].im * t[3].im; \
+ \
+ z0[0].re = t[0].re - t[1].re; \
+ z0[0].im = t[0].im - t[1].im; \
+ z0[1].re = t[4].re + t[5].re; \
+ z0[1].im = t[4].im + t[5].im; \
+ \
+ z0[2].re = t[4].re - t[5].re; \
+ z0[2].im = t[4].im - t[5].im; \
+ z0[3].re = t[0].re + t[1].re; \
+ z0[3].im = t[0].im + t[1].im; \
+ \
+ out[D1*stride].re = in[0].re + z0[3].re; \
+ out[D1*stride].im = in[0].im + z0[0].im; \
+ out[D2*stride].re = in[0].re + z0[2].re; \
+ out[D2*stride].im = in[0].im + z0[1].im; \
+ out[D3*stride].re = in[0].re + z0[1].re; \
+ out[D3*stride].im = in[0].im + z0[2].im; \
+ out[D4*stride].re = in[0].re + z0[0].re; \
+ out[D4*stride].im = in[0].im + z0[3].im; \
+}
+
+DECL_FFT5(fft5, 0, 1, 2, 3, 4)
+DECL_FFT5(fft5_m1, 0, 6, 12, 3, 9)
+DECL_FFT5(fft5_m2, 10, 1, 7, 13, 4)
+DECL_FFT5(fft5_m3, 5, 11, 2, 8, 14)
+
+static av_always_inline void fft15(FFTComplex *out, FFTComplex *in,
+ ptrdiff_t stride)
+{
+ FFTComplex tmp[15];
+
+ for (int i = 0; i < 5; i++)
+ fft3(tmp + i, in + i*3, 5);
+
+ fft5_m1(out, tmp + 0, stride);
+ fft5_m2(out, tmp + 5, stride);
+ fft5_m3(out, tmp + 10, stride);
+}
+
+#define BUTTERFLIES(a0,a1,a2,a3) {\
+ BF(t3, t5, t5, t1);\
+ BF(a2.re, a0.re, a0.re, t5);\
+ BF(a3.im, a1.im, a1.im, t3);\
+ BF(t4, t6, t2, t6);\
+ BF(a3.re, a1.re, a1.re, t4);\
+ BF(a2.im, a0.im, a0.im, t6);\
+}
+
+// force loading all the inputs before storing any.
+// this is slightly slower for small data, but avoids store->load aliasing
+// for addresses separated by large powers of 2.
+#define BUTTERFLIES_BIG(a0,a1,a2,a3) {\
+ FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
+ BF(t3, t5, t5, t1);\
+ BF(a2.re, a0.re, r0, t5);\
+ BF(a3.im, a1.im, i1, t3);\
+ BF(t4, t6, t2, t6);\
+ BF(a3.re, a1.re, r1, t4);\
+ BF(a2.im, a0.im, i0, t6);\
+}
+
+#define TRANSFORM(a0,a1,a2,a3,wre,wim) {\
+ CMUL(t1, t2, a2.re, a2.im, wre, -wim);\
+ CMUL(t5, t6, a3.re, a3.im, wre, wim);\
+ BUTTERFLIES(a0,a1,a2,a3)\
+}
+
+#define TRANSFORM_ZERO(a0,a1,a2,a3) {\
+ t1 = a2.re;\
+ t2 = a2.im;\
+ t5 = a3.re;\
+ t6 = a3.im;\
+ BUTTERFLIES(a0,a1,a2,a3)\
+}
+
+/* z[0...8n-1], w[1...2n-1] */
+#define PASS(name)\
+static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
+{\
+ FFTSample t1, t2, t3, t4, t5, t6;\
+ int o1 = 2*n;\
+ int o2 = 4*n;\
+ int o3 = 6*n;\
+ const FFTSample *wim = wre+o1;\
+ n--;\
+\
+ TRANSFORM_ZERO(z[0],z[o1],z[o2],z[o3]);\
+ TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
+ do {\
+ z += 2;\
+ wre += 2;\
+ wim -= 2;\
+ TRANSFORM(z[0],z[o1],z[o2],z[o3],wre[0],wim[0]);\
+ TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
+ } while(--n);\
+}
+
+PASS(pass)
+#undef BUTTERFLIES
+#define BUTTERFLIES BUTTERFLIES_BIG
+PASS(pass_big)
+
+#define DECL_FFT(n,n2,n4)\
+static void fft##n(FFTComplex *z)\
+{\
+ fft##n2(z);\
+ fft##n4(z+n4*2);\
+ fft##n4(z+n4*3);\
+ pass(z,FFT_NAME(ff_cos_##n),n4/2);\
+}
+
+static void fft4(FFTComplex *z)
+{
+ FFTSample t1, t2, t3, t4, t5, t6, t7, t8;
+
+ BF(t3, t1, z[0].re, z[1].re);
+ BF(t8, t6, z[3].re, z[2].re);
+ BF(z[2].re, z[0].re, t1, t6);
+ BF(t4, t2, z[0].im, z[1].im);
+ BF(t7, t5, z[2].im, z[3].im);
+ BF(z[3].im, z[1].im, t4, t8);
+ BF(z[3].re, z[1].re, t3, t7);
+ BF(z[2].im, z[0].im, t2, t5);
+}
+
+static void fft8(FFTComplex *z)
+{
+ FFTSample t1, t2, t3, t4, t5, t6;
+
+ fft4(z);
+
+ BF(t1, z[5].re, z[4].re, -z[5].re);
+ BF(t2, z[5].im, z[4].im, -z[5].im);
+ BF(t5, z[7].re, z[6].re, -z[7].re);
+ BF(t6, z[7].im, z[6].im, -z[7].im);
+
+ BUTTERFLIES(z[0],z[2],z[4],z[6]);
+ TRANSFORM(z[1],z[3],z[5],z[7],M_SQRT1_2,M_SQRT1_2);
+}
+
+static void fft16(FFTComplex *z)
+{
+ FFTSample t1, t2, t3, t4, t5, t6;
+ FFTSample cos_16_1 = FFT_NAME(ff_cos_16)[1];
+ FFTSample cos_16_3 = FFT_NAME(ff_cos_16)[3];
+
+ fft8(z);
+ fft4(z+8);
+ fft4(z+12);
+
+ TRANSFORM_ZERO(z[0],z[4],z[8],z[12]);
+ TRANSFORM(z[2],z[6],z[10],z[14],M_SQRT1_2,M_SQRT1_2);
+ TRANSFORM(z[1],z[5],z[9],z[13],cos_16_1,cos_16_3);
+ TRANSFORM(z[3],z[7],z[11],z[15],cos_16_3,cos_16_1);
+}
+
+DECL_FFT(32,16,8)
+DECL_FFT(64,32,16)
+DECL_FFT(128,64,32)
+DECL_FFT(256,128,64)
+DECL_FFT(512,256,128)
+#define pass pass_big
+DECL_FFT(1024,512,256)
+DECL_FFT(2048,1024,512)
+DECL_FFT(4096,2048,1024)
+DECL_FFT(8192,4096,2048)
+DECL_FFT(16384,8192,4096)
+DECL_FFT(32768,16384,8192)
+DECL_FFT(65536,32768,16384)
+DECL_FFT(131072,65536,32768)
+
+static void (* const fft_dispatch[])(FFTComplex*) = {
+ fft4, fft8, fft16, fft32, fft64, fft128, fft256, fft512, fft1024,
+ fft2048, fft4096, fft8192, fft16384, fft32768, fft65536, fft131072
+};
+
+#define DECL_COMP_FFT(N) \
+static void compound_fft_##N##xM(AVTXContext *s, void *_out, \
+ void *_in, ptrdiff_t stride) \
+{ \
+ const int m = s->m, *in_map = s->pfatab, *out_map = in_map + N*m; \
+ FFTComplex *in = _in; \
+ FFTComplex *out = _out; \
+ FFTComplex fft##N##in[N]; \
+ void (*fftp)(FFTComplex *z) = fft_dispatch[av_log2(m) - 2]; \
+ \
+ for (int i = 0; i < m; i++) { \
+ for (int j = 0; j < N; j++) \
+ fft##N##in[j] = in[in_map[i*N + j]]; \
+ fft##N(s->tmp + s->revtab[i], fft##N##in, m); \
+ } \
+ \
+ for (int i = 0; i < N; i++) \
+ fftp(s->tmp + m*i); \
+ \
+ for (int i = 0; i < N*m; i++) \
+ out[i] = s->tmp[out_map[i]]; \
+}
+
+DECL_COMP_FFT(3)
+DECL_COMP_FFT(5)
+DECL_COMP_FFT(15)
+
+static void monolithic_fft(AVTXContext *s, void *_out, void *_in,
+ ptrdiff_t stride)
+{
+ FFTComplex *in = _in;
+ FFTComplex *out = _out;
+ int m = s->m, mb = av_log2(m) - 2;
+ for (int i = 0; i < m; i++)
+ out[s->revtab[i]] = in[i];
+ fft_dispatch[mb](out);
+}
+
+#define DECL_COMP_IMDCT(N) \
+static void compound_imdct_##N##xM(AVTXContext *s, void *_dst, void *_src, \
+ ptrdiff_t stride) \
+{ \
+ FFTComplex fft##N##in[N]; \
+ FFTComplex *z = _dst, *exp = s->exptab; \
+ const int m = s->m, len8 = N*m >> 1; \
+ const int *in_map = s->pfatab, *out_map = in_map + N*m; \
+ const float *src = _src, *in1, *in2; \
+ void (*fftp)(FFTComplex *) = fft_dispatch[av_log2(m) - 2]; \
+ \
+ stride /= sizeof(*src); /* To convert it from bytes */ \
+ in1 = src; \
+ in2 = src + ((N*m*2) - 1) * stride; \
+ \
+ for (int i = 0; i < m; i++) { \
+ for (int j = 0; j < N; j++) { \
+ const int k = in_map[i*N + j]; \
+ FFTComplex tmp = { in2[-k*stride], in1[k*stride] }; \
+ CMUL3(fft##N##in[j], tmp, exp[k >> 1]); \
+ } \
+ fft##N(s->tmp + s->revtab[i], fft##N##in, m); \
+ } \
+ \
+ for (int i = 0; i < N; i++) \
+ fftp(s->tmp + m*i); \
+ \
+ for (int i = 0; i < len8; i++) { \
+ const int i0 = len8 + i, i1 = len8 - i - 1; \
+ const int s0 = out_map[i0], s1 = out_map[i1]; \
+ FFTComplex src1 = { s->tmp[s1].im, s->tmp[s1].re }; \
+ FFTComplex src0 = { s->tmp[s0].im, s->tmp[s0].re }; \
+ \
+ CMUL(z[i1].re, z[i0].im, src1.re, src1.im, exp[i1].im, exp[i1].re); \
+ CMUL(z[i0].re, z[i1].im, src0.re, src0.im, exp[i0].im, exp[i0].re); \
+ } \
+}
+
+DECL_COMP_IMDCT(3)
+DECL_COMP_IMDCT(5)
+DECL_COMP_IMDCT(15)
+
+#define DECL_COMP_MDCT(N) \
+static void compound_mdct_##N##xM(AVTXContext *s, void *_dst, void *_src, \
+ ptrdiff_t stride) \
+{ \
+ float *src = _src, *dst = _dst; \
+ FFTComplex *exp = s->exptab, tmp, fft##N##in[N]; \
+ const int m = s->m, len4 = N*m, len3 = len4 * 3, len8 = len4 >> 1; \
+ const int *in_map = s->pfatab, *out_map = in_map + N*m; \
+ void (*fftp)(FFTComplex *) = fft_dispatch[av_log2(m) - 2]; \
+ \
+ stride /= sizeof(*dst); \
+ \
+ for (int i = 0; i < m; i++) { /* Folding and pre-reindexing */ \
+ for (int j = 0; j < N; j++) { \
+ const int k = in_map[i*N + j]; \
+ if (k < len4) { \
+ tmp.re = -src[ len4 + k] + src[1*len4 - 1 - k]; \
+ tmp.im = -src[ len3 + k] - src[1*len3 - 1 - k]; \
+ } else { \
+ tmp.re = -src[ len4 + k] - src[5*len4 - 1 - k]; \
+ tmp.im = src[-len4 + k] - src[1*len3 - 1 - k]; \
+ } \
+ CMUL(fft##N##in[j].im, fft##N##in[j].re, tmp.re, tmp.im, \
+ exp[k >> 1].re, exp[k >> 1].im); \
+ } \
+ fft##N(s->tmp + s->revtab[i], fft##N##in, m); \
+ } \
+ \
+ for (int i = 0; i < N; i++) \
+ fftp(s->tmp + m*i); \
+ \
+ for (int i = 0; i < len8; i++) { \
+ const int i0 = len8 + i, i1 = len8 - i - 1; \
+ const int s0 = out_map[i0], s1 = out_map[i1]; \
+ FFTComplex src1 = { s->tmp[s1].re, s->tmp[s1].im }; \
+ FFTComplex src0 = { s->tmp[s0].re, s->tmp[s0].im }; \
+ \
+ CMUL(dst[2*i1*stride + stride], dst[2*i0*stride], src0.re, src0.im, \
+ exp[i0].im, exp[i0].re); \
+ CMUL(dst[2*i0*stride + stride], dst[2*i1*stride], src1.re, src1.im, \
+ exp[i1].im, exp[i1].re); \
+ } \
+}
+
+DECL_COMP_MDCT(3)
+DECL_COMP_MDCT(5)
+DECL_COMP_MDCT(15)
+
+static void monolithic_imdct(AVTXContext *s, void *_dst, void *_src,
+ ptrdiff_t stride)
+{
+ FFTComplex *z = _dst, *exp = s->exptab;
+ const int m = s->m, len8 = m >> 1;
+ const float *src = _src, *in1, *in2;
+ void (*fftp)(FFTComplex *) = fft_dispatch[av_log2(m) - 2];
+
+ stride /= sizeof(*src);
+ in1 = src;
+ in2 = src + ((m*2) - 1) * stride;
+
+ for (int i = 0; i < m; i++) {
+ FFTComplex tmp = { in2[-2*i*stride], in1[2*i*stride] };
+ CMUL3(z[s->revtab[i]], tmp, exp[i]);
+ }
+
+ fftp(z);
+
+ for (int i = 0; i < len8; i++) {
+ const int i0 = len8 + i, i1 = len8 - i - 1;
+ FFTComplex src1 = { z[i1].im, z[i1].re };
+ FFTComplex src0 = { z[i0].im, z[i0].re };
+
+ CMUL(z[i1].re, z[i0].im, src1.re, src1.im, exp[i1].im, exp[i1].re);
+ CMUL(z[i0].re, z[i1].im, src0.re, src0.im, exp[i0].im, exp[i0].re);
+ }
+}
+
+static void monolithic_mdct(AVTXContext *s, void *_dst, void *_src,
+ ptrdiff_t stride)
+{
+ float *src = _src, *dst = _dst;
+ FFTComplex *exp = s->exptab, tmp, *z = _dst;
+ const int m = s->m, len4 = m, len3 = len4 * 3, len8 = len4 >> 1;
+ void (*fftp)(FFTComplex *) = fft_dispatch[av_log2(m) - 2];
+
+ stride /= sizeof(*dst);
+
+ for (int i = 0; i < m; i++) { /* Folding and pre-reindexing */
+ const int k = 2*i;
+ if (k < len4) {
+ tmp.re = -src[ len4 + k] + src[1*len4 - 1 - k];
+ tmp.im = -src[ len3 + k] - src[1*len3 - 1 - k];
+ } else {
+ tmp.re = -src[ len4 + k] - src[5*len4 - 1 - k];
+ tmp.im = src[-len4 + k] - src[1*len3 - 1 - k];
+ }
+ CMUL(z[s->revtab[i]].im, z[s->revtab[i]].re, tmp.re, tmp.im,
+ exp[i].re, exp[i].im);
+ }
+
+ fftp(z);
+
+ for (int i = 0; i < len8; i++) {
+ const int i0 = len8 + i, i1 = len8 - i - 1;
+ FFTComplex src1 = { z[i1].re, z[i1].im };
+ FFTComplex src0 = { z[i0].re, z[i0].im };
+
+ CMUL(dst[2*i1*stride + stride], dst[2*i0*stride], src0.re, src0.im,
+ exp[i0].im, exp[i0].re);
+ CMUL(dst[2*i0*stride + stride], dst[2*i1*stride], src1.re, src1.im,
+ exp[i1].im, exp[i1].re);
+ }
+}
+
+/* Calculates the modular multiplicative inverse, not fast, replace */
+static int mulinv(int n, int m)
+{
+ n = n % m;
+ for (int x = 1; x < m; x++)
+ if (((n * x) % m) == 1)
+ return x;
+ av_assert0(0); /* Never reached */
+}
+
+/* Guaranteed to work for any n, m where gcd(n, m) == 1 */
+static int gen_compound_mapping(AVTXContext *s, int n, int m, int inv,
+ enum AVTXType type)
+{
+ int *in_map, *out_map;
+ const int len = n*m;
+ const int m_inv = mulinv(m, n);
+ const int n_inv = mulinv(n, m);
+ const int mdct = type == AV_TX_FLOAT_MDCT;
+
+ if (!(s->pfatab = av_malloc(2*len*sizeof(*s->pfatab))))
+ return AVERROR(ENOMEM);
+
+ in_map = s->pfatab;
+ out_map = s->pfatab + n*m;
+
+ /* Ruritanian map for input, CRT map for output, can be swapped */
+ for (int j = 0; j < m; j++) {
+ for (int i = 0; i < n; i++) {
+ /* Shifted by 1 to simplify forward MDCTs */
+ in_map[j*n + i] = ((i*m + j*n) % len) << mdct;
+ out_map[(i*m*m_inv + j*n*n_inv) % len] = i*m + j;
+ }
+ }
+
+ /* Change transform direction by reversing all ACs */
+ if (inv) {
+ for (int i = 0; i < m; i++) {
+ int *in = &in_map[i*n + 1]; /* Skip the DC */
+ for (int j = 0; j < ((n - 1) >> 1); j++)
+ FFSWAP(int, in[j], in[n - j - 2]);
+ }
+ }
+
+ /* Our 15-point transform is also a compound one, so embed its input map */
+ if (n == 15) {
+ for (int k = 0; k < m; k++) {
+ int tmp[15];
+ memcpy(tmp, &in_map[k*15], 15*sizeof(*tmp));
+ for (int i = 0; i < 5; i++) {
+ for (int j = 0; j < 3; j++)
+ in_map[k*15 + i*3 + j] = tmp[(i*3 + j*5) % 15];
+ }
+ }
+ }
+
+ return 0;
+}
+
+static int split_radix_permutation(int i, int n, int inverse)
+{
+ int m;
+ if (n <= 2)
+ return i & 1;
+ m = n >> 1;
+ if (!(i & m))
+ return split_radix_permutation(i, m, inverse)*2;
+ m >>= 1;
+ if (inverse == !(i & m))
+ return split_radix_permutation(i, m, inverse)*4 + 1;
+ else
+ return split_radix_permutation(i, m, inverse)*4 - 1;
+}
+
+static int get_ptwo_revtab(AVTXContext *s, int m, int inv)
+{
+ if (!(s->revtab = av_malloc(m*sizeof(*s->revtab))))
+ return AVERROR(ENOMEM);
+
+ /* Default */
+ for (int i = 0; i < m; i++) {
+ int k = -split_radix_permutation(i, m, inv) & (m - 1);
+ s->revtab[k] = i;
+ }
+
+ return 0;
+}
+
+static int gen_mdct_exptab(AVTXContext *s, int len4, double scale)
+{
+ const double theta = (scale < 0 ? len4 : 0) + 1.0/8.0;
+
+ if (!(s->exptab = av_malloc_array(len4, sizeof(*s->exptab))))
+ return AVERROR(ENOMEM);
+
+ scale = sqrt(fabs(scale));
+ for (int i = 0; i < len4; i++) {
+ const double alpha = M_PI_2 * (i + theta) / len4;
+ s->exptab[i].re = cos(alpha) * scale;
+ s->exptab[i].im = sin(alpha) * scale;
+ }
+
+ return 0;
+}
+
+av_cold void av_tx_uninit(AVTXContext **ctx)
+{
+ if (!(*ctx))
+ return;
+
+ av_free((*ctx)->pfatab);
+ av_free((*ctx)->exptab);
+ av_free((*ctx)->revtab);
+ av_free((*ctx)->tmp);
+
+ av_freep(ctx);
+}
+
+static int init_mdct_fft(AVTXContext *s, av_tx_fn *tx, enum AVTXType type,
+ int inv, int len, const void *scale, uint64_t flags)
+{
+ int err, n = 1, m = 1, max_ptwo = 1 << (FF_ARRAY_ELEMS(fft_dispatch) + 1);
+
+ if (type == AV_TX_FLOAT_MDCT)
+ len >>= 1;
+
+#define CHECK_FACTOR(DST, FACTOR, SRC) \
+ if (DST == 1 && !(SRC % FACTOR)) { \
+ DST = FACTOR; \
+ SRC /= FACTOR; \
+ }
+ CHECK_FACTOR(n, 15, len)
+ CHECK_FACTOR(n, 5, len)
+ CHECK_FACTOR(n, 3, len)
+#undef CHECK_NPTWO_FACTOR
+
+ /* len must be a power of two now */
+ if (!(len & (len - 1)) && len >= 4 && len <= max_ptwo) {
+ m = len;
+ len = 1;
+ }
+
+ /* Filter out direct 3, 5 and 15 transforms, too niche */
+ if (len > 1 || m == 1) {
+ av_log(NULL, AV_LOG_ERROR, "Unsupported transform size: n = %i, "
+ "m = %i, residual = %i!\n", n, m, len);
+ return AVERROR(EINVAL);
+ } else if (n > 1 && m > 1) { /* 2D transform case */
+ if ((err = gen_compound_mapping(s, n, m, inv, type)))
+ return err;
+ if (!(s->tmp = av_malloc(n*m*sizeof(*s->tmp))))
+ return AVERROR(ENOMEM);
+ *tx = n == 3 ? compound_fft_3xM :
+ n == 5 ? compound_fft_5xM :
+ compound_fft_15xM;
+ if (type == AV_TX_FLOAT_MDCT)
+ *tx = n == 3 ? inv ? compound_imdct_3xM : compound_mdct_3xM :
+ n == 5 ? inv ? compound_imdct_5xM : compound_mdct_5xM :
+ inv ? compound_imdct_15xM : compound_mdct_15xM;
+ } else { /* Direct transform case */
+ *tx = monolithic_fft;
+ if (type == AV_TX_FLOAT_MDCT)
+ *tx = inv ? monolithic_imdct : monolithic_mdct;
+ }
+
+ if (n != 1)
+ ff_thread_once(&tabs_53_once, ff_init_53_tabs);
+ if (m != 1) {
+ get_ptwo_revtab(s, m, inv);
+ for (int i = 4; i <= av_log2(m); i++)
+ ff_init_ff_cos_tabs(i);
+ }
+
+ if (type == AV_TX_FLOAT_MDCT)
+ if ((err = gen_mdct_exptab(s, n*m, *((float *)scale))))
+ return err;
+
+ s->n = n;
+ s->m = m;
+
+ return 0;
+}
+
+av_cold int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type,
+ int inv, int len, const void *scale, uint64_t flags)
+{
+ int err;
+ AVTXContext *s = av_mallocz(sizeof(*s));
+ if (!s)
+ return AVERROR(ENOMEM);
+
+ switch (type) {
+ case AV_TX_FLOAT_FFT:
+ case AV_TX_FLOAT_MDCT:
+ if ((err = init_mdct_fft(s, tx, type, inv, len, scale, flags)))
+ goto fail;
+ break;
+ default:
+ err = AVERROR(EINVAL);
+ goto fail;
+ }
+
+ *ctx = s;
+
+ return 0;
+
+fail:
+ av_tx_uninit(&s);
+ *tx = NULL;
+ return err;
+}
diff --git a/chromium/third_party/ffmpeg/libavutil/tx.h b/chromium/third_party/ffmpeg/libavutil/tx.h
new file mode 100644
index 00000000000..b1f2d963533
--- /dev/null
+++ b/chromium/third_party/ffmpeg/libavutil/tx.h
@@ -0,0 +1,81 @@
+/*
+ * 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_TX_H
+#define AVUTIL_TX_H
+
+#include <stdint.h>
+#include <stddef.h>
+
+typedef struct AVTXContext AVTXContext;
+
+typedef struct AVComplexFloat {
+ float re, im;
+} AVComplexFloat;
+
+enum AVTXType {
+ /**
+ * Standard complex to complex FFT with sample data type AVComplexFloat.
+ * Scaling currently unsupported
+ */
+ AV_TX_FLOAT_FFT = 0,
+ /**
+ * Standard MDCT with sample data type of float and a scale type of
+ * float. Length is the frame size, not the window size (which is 2x frame)
+ */
+ AV_TX_FLOAT_MDCT = 1,
+};
+
+/**
+ * Function pointer to a function to perform the transform.
+ *
+ * @note Using a different context than the one allocated during av_tx_init()
+ * is not allowed.
+ *
+ * @param s the transform context
+ * @param out the output array
+ * @param in the input array
+ * @param stride the input or output stride (depending on transform direction)
+ * in bytes, currently implemented for all MDCT transforms
+ */
+typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
+
+/**
+ * Initialize a transform context with the given configuration
+ * Currently power of two lengths from 4 to 131072 are supported, along with
+ * any length decomposable to a power of two and either 3, 5 or 15.
+ *
+ * @param ctx the context to allocate, will be NULL on error
+ * @param tx pointer to the transform function pointer to set
+ * @param type type the type of transform
+ * @param inv whether to do an inverse or a forward transform
+ * @param len the size of the transform in samples
+ * @param scale pointer to the value to scale the output if supported by type
+ * @param flags currently unused
+ *
+ * @return 0 on success, negative error code on failure
+ */
+int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type,
+ int inv, int len, const void *scale, uint64_t flags);
+
+/**
+ * Frees a context and sets ctx to NULL, does nothing when ctx == NULL
+ */
+void av_tx_uninit(AVTXContext **ctx);
+
+#endif /* AVUTIL_TX_H */
diff --git a/chromium/third_party/ffmpeg/libavutil/version.h b/chromium/third_party/ffmpeg/libavutil/version.h
index 1fcdea95bf4..e16b93e877e 100644
--- a/chromium/third_party/ffmpeg/libavutil/version.h
+++ b/chromium/third_party/ffmpeg/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 26
+#define LIBAVUTIL_VERSION_MINOR 30
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/chromium/third_party/ffmpeg/libswresample/swresample.c b/chromium/third_party/ffmpeg/libswresample/swresample.c
index 6d28e6a7983..1ac5ef9a309 100644
--- a/chromium/third_party/ffmpeg/libswresample/swresample.c
+++ b/chromium/third_party/ffmpeg/libswresample/swresample.c
@@ -164,6 +164,14 @@ av_cold int swr_init(struct SwrContext *s){
return AVERROR(EINVAL);
}
+ if(s-> in_sample_rate <= 0){
+ av_log(s, AV_LOG_ERROR, "Requested input sample rate %d is invalid\n", s->in_sample_rate);
+ return AVERROR(EINVAL);
+ }
+ if(s->out_sample_rate <= 0){
+ av_log(s, AV_LOG_ERROR, "Requested output sample rate %d is invalid\n", s->out_sample_rate);
+ return AVERROR(EINVAL);
+ }
s->out.ch_count = s-> user_out_ch_count;
s-> in.ch_count = s-> user_in_ch_count;
s->used_ch_count = s->user_used_ch_count;
diff --git a/chromium/third_party/ffmpeg/libswscale/input.c b/chromium/third_party/ffmpeg/libswscale/input.c
index c2dc356b5de..064f8da314e 100644
--- a/chromium/third_party/ffmpeg/libswscale/input.c
+++ b/chromium/third_party/ffmpeg/libswscale/input.c
@@ -1020,9 +1020,11 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c->chrToYV12 = uyvyToUV_c;
break;
case AV_PIX_FMT_NV12:
+ case AV_PIX_FMT_NV24:
c->chrToYV12 = nv12ToUV_c;
break;
case AV_PIX_FMT_NV21:
+ case AV_PIX_FMT_NV42:
c->chrToYV12 = nv21ToUV_c;
break;
case AV_PIX_FMT_RGB8:
diff --git a/chromium/third_party/ffmpeg/libswscale/output.c b/chromium/third_party/ffmpeg/libswscale/output.c
index d3401f0cd1e..26b0ff3d480 100644
--- a/chromium/third_party/ffmpeg/libswscale/output.c
+++ b/chromium/third_party/ffmpeg/libswscale/output.c
@@ -410,7 +410,8 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS
const uint8_t *chrDither = c->chrDither8;
int i;
- if (dstFormat == AV_PIX_FMT_NV12)
+ if (dstFormat == AV_PIX_FMT_NV12 ||
+ dstFormat == AV_PIX_FMT_NV24)
for (i=0; i<chrDstW; i++) {
int u = chrDither[i & 7] << 12;
int v = chrDither[(i + 3) & 7] << 12;
@@ -2496,7 +2497,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
} else {
*yuv2plane1 = yuv2plane1_8_c;
*yuv2planeX = yuv2planeX_8_c;
- if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)
+ if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21 ||
+ dstFormat == AV_PIX_FMT_NV24 || dstFormat == AV_PIX_FMT_NV42)
*yuv2nv12cX = yuv2nv12cX_c;
}
diff --git a/chromium/third_party/ffmpeg/libswscale/ppc/swscale_altivec.c b/chromium/third_party/ffmpeg/libswscale/ppc/swscale_altivec.c
index 3cd9782da4e..6b8cc2c194a 100644
--- a/chromium/third_party/ffmpeg/libswscale/ppc/swscale_altivec.c
+++ b/chromium/third_party/ffmpeg/libswscale/ppc/swscale_altivec.c
@@ -247,8 +247,7 @@ av_cold void ff_sws_init_swscale_ppc(SwsContext *c)
if (c->srcBpc == 8 && c->dstBpc <= 14) {
c->hyScale = c->hcScale = hScale_real_altivec;
}
- if (!is16BPS(dstFormat) && !isNBPS(dstFormat) &&
- dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
+ if (!is16BPS(dstFormat) && !isNBPS(dstFormat) && !isSemiPlanarYUV(dstFormat) &&
dstFormat != AV_PIX_FMT_GRAYF32BE && dstFormat != AV_PIX_FMT_GRAYF32LE &&
!c->needAlpha) {
c->yuv2planeX = yuv2planeX_altivec;
diff --git a/chromium/third_party/ffmpeg/libswscale/ppc/swscale_vsx.c b/chromium/third_party/ffmpeg/libswscale/ppc/swscale_vsx.c
index ba00791dcbc..75dee5ea588 100644
--- a/chromium/third_party/ffmpeg/libswscale/ppc/swscale_vsx.c
+++ b/chromium/third_party/ffmpeg/libswscale/ppc/swscale_vsx.c
@@ -1661,6 +1661,410 @@ YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422)
YUV2PACKEDWRAPPER(yuv2, 422, yvyu422, AV_PIX_FMT_YVYU422)
YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422)
+static void hyscale_fast_vsx(SwsContext *c, int16_t *dst, int dstWidth,
+ const uint8_t *src, int srcW, int xInc)
+{
+ int i;
+ unsigned int xpos = 0, xx;
+ vector uint8_t vin, vin2, vperm;
+ vector int8_t vmul, valpha;
+ vector int16_t vtmp, vtmp2, vtmp3, vtmp4;
+ vector uint16_t vd_l, vd_r, vcoord16[2];
+ vector uint32_t vcoord[4];
+ const vector uint32_t vadd = (vector uint32_t) {
+ 0,
+ xInc * 1,
+ xInc * 2,
+ xInc * 3,
+ };
+ const vector uint16_t vadd16 = (vector uint16_t) { // Modulo math
+ 0,
+ xInc * 1,
+ xInc * 2,
+ xInc * 3,
+ xInc * 4,
+ xInc * 5,
+ xInc * 6,
+ xInc * 7,
+ };
+ const vector uint32_t vshift16 = vec_splats((uint32_t) 16);
+ const vector uint16_t vshift9 = vec_splat_u16(9);
+ const vector uint8_t vzero = vec_splat_u8(0);
+ const vector uint16_t vshift = vec_splat_u16(7);
+
+ for (i = 0; i < dstWidth; i += 16) {
+ vcoord16[0] = vec_splats((uint16_t) xpos);
+ vcoord16[1] = vec_splats((uint16_t) (xpos + xInc * 8));
+
+ vcoord16[0] = vec_add(vcoord16[0], vadd16);
+ vcoord16[1] = vec_add(vcoord16[1], vadd16);
+
+ vcoord16[0] = vec_sr(vcoord16[0], vshift9);
+ vcoord16[1] = vec_sr(vcoord16[1], vshift9);
+ valpha = (vector int8_t) vec_pack(vcoord16[0], vcoord16[1]);
+
+ xx = xpos >> 16;
+ vin = vec_vsx_ld(0, &src[xx]);
+
+ vcoord[0] = vec_splats(xpos & 0xffff);
+ vcoord[1] = vec_splats((xpos & 0xffff) + xInc * 4);
+ vcoord[2] = vec_splats((xpos & 0xffff) + xInc * 8);
+ vcoord[3] = vec_splats((xpos & 0xffff) + xInc * 12);
+
+ vcoord[0] = vec_add(vcoord[0], vadd);
+ vcoord[1] = vec_add(vcoord[1], vadd);
+ vcoord[2] = vec_add(vcoord[2], vadd);
+ vcoord[3] = vec_add(vcoord[3], vadd);
+
+ vcoord[0] = vec_sr(vcoord[0], vshift16);
+ vcoord[1] = vec_sr(vcoord[1], vshift16);
+ vcoord[2] = vec_sr(vcoord[2], vshift16);
+ vcoord[3] = vec_sr(vcoord[3], vshift16);
+
+ vcoord16[0] = vec_pack(vcoord[0], vcoord[1]);
+ vcoord16[1] = vec_pack(vcoord[2], vcoord[3]);
+ vperm = vec_pack(vcoord16[0], vcoord16[1]);
+
+ vin = vec_perm(vin, vin, vperm);
+
+ vin2 = vec_vsx_ld(1, &src[xx]);
+ vin2 = vec_perm(vin2, vin2, vperm);
+
+ vmul = (vector int8_t) vec_sub(vin2, vin);
+ vtmp = vec_mule(vmul, valpha);
+ vtmp2 = vec_mulo(vmul, valpha);
+ vtmp3 = vec_mergeh(vtmp, vtmp2);
+ vtmp4 = vec_mergel(vtmp, vtmp2);
+
+ vd_l = (vector uint16_t) vec_mergeh(vin, vzero);
+ vd_r = (vector uint16_t) vec_mergel(vin, vzero);
+ vd_l = vec_sl(vd_l, vshift);
+ vd_r = vec_sl(vd_r, vshift);
+
+ vd_l = vec_add(vd_l, (vector uint16_t) vtmp3);
+ vd_r = vec_add(vd_r, (vector uint16_t) vtmp4);
+
+ vec_st((vector int16_t) vd_l, 0, &dst[i]);
+ vec_st((vector int16_t) vd_r, 0, &dst[i + 8]);
+
+ xpos += xInc * 16;
+ }
+ for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--)
+ dst[i] = src[srcW-1]*128;
+}
+
+#define HCSCALE(in, out) \
+ vin = vec_vsx_ld(0, &in[xx]); \
+ vin = vec_perm(vin, vin, vperm); \
+\
+ vin2 = vec_vsx_ld(1, &in[xx]); \
+ vin2 = vec_perm(vin2, vin2, vperm); \
+\
+ vtmp = vec_mule(vin, valphaxor); \
+ vtmp2 = vec_mulo(vin, valphaxor); \
+ vtmp3 = vec_mergeh(vtmp, vtmp2); \
+ vtmp4 = vec_mergel(vtmp, vtmp2); \
+\
+ vtmp = vec_mule(vin2, valpha); \
+ vtmp2 = vec_mulo(vin2, valpha); \
+ vd_l = vec_mergeh(vtmp, vtmp2); \
+ vd_r = vec_mergel(vtmp, vtmp2); \
+\
+ vd_l = vec_add(vd_l, vtmp3); \
+ vd_r = vec_add(vd_r, vtmp4); \
+\
+ vec_st((vector int16_t) vd_l, 0, &out[i]); \
+ vec_st((vector int16_t) vd_r, 0, &out[i + 8])
+
+static void hcscale_fast_vsx(SwsContext *c, int16_t *dst1, int16_t *dst2,
+ int dstWidth, const uint8_t *src1,
+ const uint8_t *src2, int srcW, int xInc)
+{
+ int i;
+ unsigned int xpos = 0, xx;
+ vector uint8_t vin, vin2, vperm;
+ vector uint8_t valpha, valphaxor;
+ vector uint16_t vtmp, vtmp2, vtmp3, vtmp4;
+ vector uint16_t vd_l, vd_r, vcoord16[2];
+ vector uint32_t vcoord[4];
+ const vector uint8_t vxor = vec_splats((uint8_t) 127);
+ const vector uint32_t vadd = (vector uint32_t) {
+ 0,
+ xInc * 1,
+ xInc * 2,
+ xInc * 3,
+ };
+ const vector uint16_t vadd16 = (vector uint16_t) { // Modulo math
+ 0,
+ xInc * 1,
+ xInc * 2,
+ xInc * 3,
+ xInc * 4,
+ xInc * 5,
+ xInc * 6,
+ xInc * 7,
+ };
+ const vector uint32_t vshift16 = vec_splats((uint32_t) 16);
+ const vector uint16_t vshift9 = vec_splat_u16(9);
+
+ for (i = 0; i < dstWidth; i += 16) {
+ vcoord16[0] = vec_splats((uint16_t) xpos);
+ vcoord16[1] = vec_splats((uint16_t) (xpos + xInc * 8));
+
+ vcoord16[0] = vec_add(vcoord16[0], vadd16);
+ vcoord16[1] = vec_add(vcoord16[1], vadd16);
+
+ vcoord16[0] = vec_sr(vcoord16[0], vshift9);
+ vcoord16[1] = vec_sr(vcoord16[1], vshift9);
+ valpha = vec_pack(vcoord16[0], vcoord16[1]);
+ valphaxor = vec_xor(valpha, vxor);
+
+ xx = xpos >> 16;
+
+ vcoord[0] = vec_splats(xpos & 0xffff);
+ vcoord[1] = vec_splats((xpos & 0xffff) + xInc * 4);
+ vcoord[2] = vec_splats((xpos & 0xffff) + xInc * 8);
+ vcoord[3] = vec_splats((xpos & 0xffff) + xInc * 12);
+
+ vcoord[0] = vec_add(vcoord[0], vadd);
+ vcoord[1] = vec_add(vcoord[1], vadd);
+ vcoord[2] = vec_add(vcoord[2], vadd);
+ vcoord[3] = vec_add(vcoord[3], vadd);
+
+ vcoord[0] = vec_sr(vcoord[0], vshift16);
+ vcoord[1] = vec_sr(vcoord[1], vshift16);
+ vcoord[2] = vec_sr(vcoord[2], vshift16);
+ vcoord[3] = vec_sr(vcoord[3], vshift16);
+
+ vcoord16[0] = vec_pack(vcoord[0], vcoord[1]);
+ vcoord16[1] = vec_pack(vcoord[2], vcoord[3]);
+ vperm = vec_pack(vcoord16[0], vcoord16[1]);
+
+ HCSCALE(src1, dst1);
+ HCSCALE(src2, dst2);
+
+ xpos += xInc * 16;
+ }
+ for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) {
+ dst1[i] = src1[srcW-1]*128;
+ dst2[i] = src2[srcW-1]*128;
+ }
+}
+
+#undef HCSCALE
+
+static void hScale8To19_vsx(SwsContext *c, int16_t *_dst, int dstW,
+ const uint8_t *src, const int16_t *filter,
+ const int32_t *filterPos, int filterSize)
+{
+ int i, j;
+ int32_t *dst = (int32_t *) _dst;
+ vector int16_t vfilter, vin;
+ vector uint8_t vin8;
+ vector int32_t vout;
+ const vector uint8_t vzero = vec_splat_u8(0);
+ const vector uint8_t vunusedtab[8] = {
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf},
+ (vector uint8_t) {0x0, 0x1, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0x10, 0x10},
+ };
+ const vector uint8_t vunused = vunusedtab[filterSize % 8];
+
+ if (filterSize == 1) {
+ for (i = 0; i < dstW; i++) {
+ int srcPos = filterPos[i];
+ int val = 0;
+ for (j = 0; j < filterSize; j++) {
+ val += ((int)src[srcPos + j]) * filter[filterSize * i + j];
+ }
+ dst[i] = FFMIN(val >> 3, (1 << 19) - 1); // the cubic equation does overflow ...
+ }
+ } else {
+ for (i = 0; i < dstW; i++) {
+ const int srcPos = filterPos[i];
+ vout = vec_splat_s32(0);
+ for (j = 0; j < filterSize; j += 8) {
+ vin8 = vec_vsx_ld(0, &src[srcPos + j]);
+ vin = (vector int16_t) vec_mergeh(vin8, vzero);
+ if (j + 8 > filterSize) // Remove the unused elements on the last round
+ vin = vec_perm(vin, (vector int16_t) vzero, vunused);
+
+ vfilter = vec_vsx_ld(0, &filter[filterSize * i + j]);
+ vout = vec_msums(vin, vfilter, vout);
+ }
+ vout = vec_sums(vout, (vector int32_t) vzero);
+ dst[i] = FFMIN(vout[3] >> 3, (1 << 19) - 1);
+ }
+ }
+}
+
+static void hScale16To19_vsx(SwsContext *c, int16_t *_dst, int dstW,
+ const uint8_t *_src, const int16_t *filter,
+ const int32_t *filterPos, int filterSize)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+ int i, j;
+ int32_t *dst = (int32_t *) _dst;
+ const uint16_t *src = (const uint16_t *) _src;
+ int bits = desc->comp[0].depth - 1;
+ int sh = bits - 4;
+ vector int16_t vfilter, vin;
+ vector int32_t vout, vtmp, vtmp2, vfilter32_l, vfilter32_r;
+ const vector uint8_t vzero = vec_splat_u8(0);
+ const vector uint8_t vunusedtab[8] = {
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf},
+ (vector uint8_t) {0x0, 0x1, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0x10, 0x10},
+ };
+ const vector uint8_t vunused = vunusedtab[filterSize % 8];
+
+ if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
+ sh = 9;
+ } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
+ sh = 16 - 1 - 4;
+ }
+
+ if (filterSize == 1) {
+ for (i = 0; i < dstW; i++) {
+ int srcPos = filterPos[i];
+ int val = 0;
+
+ for (j = 0; j < filterSize; j++) {
+ val += src[srcPos + j] * filter[filterSize * i + j];
+ }
+ // filter=14 bit, input=16 bit, output=30 bit, >> 11 makes 19 bit
+ dst[i] = FFMIN(val >> sh, (1 << 19) - 1);
+ }
+ } else {
+ for (i = 0; i < dstW; i++) {
+ const int srcPos = filterPos[i];
+ vout = vec_splat_s32(0);
+ for (j = 0; j < filterSize; j += 8) {
+ vin = (vector int16_t) vec_vsx_ld(0, &src[srcPos + j]);
+ if (j + 8 > filterSize) // Remove the unused elements on the last round
+ vin = vec_perm(vin, (vector int16_t) vzero, vunused);
+
+ vfilter = vec_vsx_ld(0, &filter[filterSize * i + j]);
+ vfilter32_l = vec_unpackh(vfilter);
+ vfilter32_r = vec_unpackl(vfilter);
+
+ vtmp = (vector int32_t) vec_mergeh(vin, (vector int16_t) vzero);
+ vtmp2 = (vector int32_t) vec_mergel(vin, (vector int16_t) vzero);
+
+ vtmp = vec_mul(vtmp, vfilter32_l);
+ vtmp2 = vec_mul(vtmp2, vfilter32_r);
+
+ vout = vec_adds(vout, vtmp);
+ vout = vec_adds(vout, vtmp2);
+ }
+ vout = vec_sums(vout, (vector int32_t) vzero);
+ dst[i] = FFMIN(vout[3] >> sh, (1 << 19) - 1);
+ }
+ }
+}
+
+static void hScale16To15_vsx(SwsContext *c, int16_t *dst, int dstW,
+ const uint8_t *_src, const int16_t *filter,
+ const int32_t *filterPos, int filterSize)
+{
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+ int i, j;
+ const uint16_t *src = (const uint16_t *) _src;
+ int sh = desc->comp[0].depth - 1;
+ vector int16_t vfilter, vin;
+ vector int32_t vout, vtmp, vtmp2, vfilter32_l, vfilter32_r;
+ const vector uint8_t vzero = vec_splat_u8(0);
+ const vector uint8_t vunusedtab[8] = {
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf},
+ (vector uint8_t) {0x0, 0x1, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x10, 0x10, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x10, 0x10,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0x10, 0x10, 0x10, 0x10},
+ (vector uint8_t) {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
+ 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0x10, 0x10},
+ };
+ const vector uint8_t vunused = vunusedtab[filterSize % 8];
+
+ if (sh<15) {
+ sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
+ } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
+ sh = 16 - 1;
+ }
+
+ if (filterSize == 1) {
+ for (i = 0; i < dstW; i++) {
+ int srcPos = filterPos[i];
+ int val = 0;
+
+ for (j = 0; j < filterSize; j++) {
+ val += src[srcPos + j] * filter[filterSize * i + j];
+ }
+ // filter=14 bit, input=16 bit, output=30 bit, >> 15 makes 15 bit
+ dst[i] = FFMIN(val >> sh, (1 << 15) - 1);
+ }
+ } else {
+ for (i = 0; i < dstW; i++) {
+ const int srcPos = filterPos[i];
+ vout = vec_splat_s32(0);
+ for (j = 0; j < filterSize; j += 8) {
+ vin = (vector int16_t) vec_vsx_ld(0, &src[srcPos + j]);
+ if (j + 8 > filterSize) // Remove the unused elements on the last round
+ vin = vec_perm(vin, (vector int16_t) vzero, vunused);
+
+ vfilter = vec_vsx_ld(0, &filter[filterSize * i + j]);
+ vfilter32_l = vec_unpackh(vfilter);
+ vfilter32_r = vec_unpackl(vfilter);
+
+ vtmp = (vector int32_t) vec_mergeh(vin, (vector int16_t) vzero);
+ vtmp2 = (vector int32_t) vec_mergel(vin, (vector int16_t) vzero);
+
+ vtmp = vec_mul(vtmp, vfilter32_l);
+ vtmp2 = vec_mul(vtmp2, vfilter32_r);
+
+ vout = vec_adds(vout, vtmp);
+ vout = vec_adds(vout, vtmp2);
+ }
+ vout = vec_sums(vout, (vector int32_t) vzero);
+ dst[i] = FFMIN(vout[3] >> sh, (1 << 15) - 1);
+ }
+ }
+}
+
#endif /* !HAVE_BIGENDIAN */
#endif /* HAVE_VSX */
@@ -1670,16 +2074,29 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
#if HAVE_VSX
enum AVPixelFormat dstFormat = c->dstFormat;
const int cpu_flags = av_get_cpu_flags();
+ const unsigned char power8 = HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8;
if (!(cpu_flags & AV_CPU_FLAG_VSX))
return;
#if !HAVE_BIGENDIAN
- if (c->srcBpc == 8 && c->dstBpc <= 14) {
- c->hyScale = c->hcScale = hScale_real_vsx;
+ if (c->srcBpc == 8) {
+ if (c->dstBpc <= 14) {
+ c->hyScale = c->hcScale = hScale_real_vsx;
+ if (c->flags & SWS_FAST_BILINEAR && c->dstW >= c->srcW && c->chrDstW >= c->chrSrcW) {
+ c->hyscale_fast = hyscale_fast_vsx;
+ c->hcscale_fast = hcscale_fast_vsx;
+ }
+ } else {
+ c->hyScale = c->hcScale = hScale8To19_vsx;
+ }
+ } else {
+ if (power8) {
+ c->hyScale = c->hcScale = c->dstBpc > 14 ? hScale16To19_vsx
+ : hScale16To15_vsx;
+ }
}
- if (!is16BPS(dstFormat) && !isNBPS(dstFormat) &&
- dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
+ if (!is16BPS(dstFormat) && !isNBPS(dstFormat) && !isSemiPlanarYUV(dstFormat) &&
dstFormat != AV_PIX_FMT_GRAYF32BE && dstFormat != AV_PIX_FMT_GRAYF32LE &&
!c->needAlpha) {
c->yuv2planeX = yuv2planeX_vsx;
@@ -1727,21 +2144,21 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
if (c->flags & SWS_FULL_CHR_H_INT) {
switch (dstFormat) {
case AV_PIX_FMT_RGB24:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
c->yuv2packed1 = yuv2rgb24_full_1_vsx;
c->yuv2packed2 = yuv2rgb24_full_2_vsx;
c->yuv2packedX = yuv2rgb24_full_X_vsx;
}
break;
case AV_PIX_FMT_BGR24:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
c->yuv2packed1 = yuv2bgr24_full_1_vsx;
c->yuv2packed2 = yuv2bgr24_full_2_vsx;
c->yuv2packedX = yuv2bgr24_full_X_vsx;
}
break;
case AV_PIX_FMT_BGRA:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2bgrx32_full_1_vsx;
c->yuv2packed2 = yuv2bgrx32_full_2_vsx;
@@ -1750,7 +2167,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_RGBA:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2rgbx32_full_1_vsx;
c->yuv2packed2 = yuv2rgbx32_full_2_vsx;
@@ -1759,7 +2176,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_ARGB:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2xrgb32_full_1_vsx;
c->yuv2packed2 = yuv2xrgb32_full_2_vsx;
@@ -1768,7 +2185,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_ABGR:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2xbgr32_full_1_vsx;
c->yuv2packed2 = yuv2xbgr32_full_2_vsx;
@@ -1795,7 +2212,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
c->yuv2packedX = yuv2uyvy422_X_vsx;
break;
case AV_PIX_FMT_BGRA:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2bgrx32_1_vsx;
c->yuv2packed2 = yuv2bgrx32_2_vsx;
@@ -1803,7 +2220,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_RGBA:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2rgbx32_1_vsx;
c->yuv2packed2 = yuv2rgbx32_2_vsx;
@@ -1811,7 +2228,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_ARGB:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2xrgb32_1_vsx;
c->yuv2packed2 = yuv2xrgb32_2_vsx;
@@ -1819,7 +2236,7 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_ABGR:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
if (!c->needAlpha) {
c->yuv2packed1 = yuv2xbgr32_1_vsx;
c->yuv2packed2 = yuv2xbgr32_2_vsx;
@@ -1827,13 +2244,13 @@ av_cold void ff_sws_init_swscale_vsx(SwsContext *c)
}
break;
case AV_PIX_FMT_RGB24:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
c->yuv2packed1 = yuv2rgb24_1_vsx;
c->yuv2packed2 = yuv2rgb24_2_vsx;
}
break;
case AV_PIX_FMT_BGR24:
- if (HAVE_POWER8 && cpu_flags & AV_CPU_FLAG_POWER8) {
+ if (power8) {
c->yuv2packed1 = yuv2bgr24_1_vsx;
c->yuv2packed2 = yuv2bgr24_2_vsx;
}
diff --git a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
index be04a236d87..e0b9e99373c 100644
--- a/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
+++ b/chromium/third_party/ffmpeg/libswscale/swscale_unscaled.c
@@ -180,6 +180,47 @@ static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
return srcSliceH;
}
+static int planarToNv24Wrapper(SwsContext *c, const uint8_t *src[],
+ int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t *dstParam[],
+ int dstStride[])
+{
+ uint8_t *dst = dstParam[1] + dstStride[1] * srcSliceY;
+
+ copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
+ dstParam[0], dstStride[0]);
+
+ if (c->dstFormat == AV_PIX_FMT_NV24)
+ interleaveBytes(src[1], src[2], dst, c->chrSrcW, srcSliceH,
+ srcStride[1], srcStride[2], dstStride[1]);
+ else
+ interleaveBytes(src[2], src[1], dst, c->chrSrcW, srcSliceH,
+ srcStride[2], srcStride[1], dstStride[1]);
+
+ return srcSliceH;
+}
+
+static int nv24ToPlanarWrapper(SwsContext *c, const uint8_t *src[],
+ int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t *dstParam[],
+ int dstStride[])
+{
+ uint8_t *dst1 = dstParam[1] + dstStride[1] * srcSliceY;
+ uint8_t *dst2 = dstParam[2] + dstStride[2] * srcSliceY;
+
+ copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
+ dstParam[0], dstStride[0]);
+
+ if (c->srcFormat == AV_PIX_FMT_NV24)
+ deinterleaveBytes(src[1], dst1, dst2, c->chrSrcW, srcSliceH,
+ srcStride[1], dstStride[1], dstStride[2]);
+ else
+ deinterleaveBytes(src[1], dst2, dst1, c->chrSrcW, srcSliceH,
+ srcStride[1], dstStride[2], dstStride[1]);
+
+ return srcSliceH;
+}
+
static int planarToP01xWrapper(SwsContext *c, const uint8_t *src8[],
int srcStride[], int srcSliceY,
int srcSliceH, uint8_t *dstParam8[],
@@ -1872,11 +1913,21 @@ void ff_get_unscaled_swscale(SwsContext *c)
(dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) {
c->swscale = planarToNv12Wrapper;
}
+ /* yv24_to_nv24 */
+ if ((srcFormat == AV_PIX_FMT_YUV444P || srcFormat == AV_PIX_FMT_YUVA444P) &&
+ (dstFormat == AV_PIX_FMT_NV24 || dstFormat == AV_PIX_FMT_NV42)) {
+ c->swscale = planarToNv24Wrapper;
+ }
/* nv12_to_yv12 */
if (dstFormat == AV_PIX_FMT_YUV420P &&
(srcFormat == AV_PIX_FMT_NV12 || srcFormat == AV_PIX_FMT_NV21)) {
c->swscale = nv12ToPlanarWrapper;
}
+ /* nv24_to_yv24 */
+ if (dstFormat == AV_PIX_FMT_YUV444P &&
+ (srcFormat == AV_PIX_FMT_NV24 || srcFormat == AV_PIX_FMT_NV42)) {
+ c->swscale = nv24ToPlanarWrapper;
+ }
/* yuv2bgr */
if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P ||
srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) &&
diff --git a/chromium/third_party/ffmpeg/libswscale/utils.c b/chromium/third_party/ffmpeg/libswscale/utils.c
index df68bcc0d9b..1b1f7795325 100644
--- a/chromium/third_party/ffmpeg/libswscale/utils.c
+++ b/chromium/third_party/ffmpeg/libswscale/utils.c
@@ -264,6 +264,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUVA422P12LE] = { 1, 1 },
[AV_PIX_FMT_YUVA444P12BE] = { 1, 1 },
[AV_PIX_FMT_YUVA444P12LE] = { 1, 1 },
+ [AV_PIX_FMT_NV24] = { 1, 1 },
+ [AV_PIX_FMT_NV42] = { 1, 1 },
};
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
diff --git a/chromium/third_party/ffmpeg/libswscale/version.h b/chromium/third_party/ffmpeg/libswscale/version.h
index 0e28a76e64d..891c76d915b 100644
--- a/chromium/third_party/ffmpeg/libswscale/version.h
+++ b/chromium/third_party/ffmpeg/libswscale/version.h
@@ -28,7 +28,7 @@
#define LIBSWSCALE_VERSION_MAJOR 5
#define LIBSWSCALE_VERSION_MINOR 4
-#define LIBSWSCALE_VERSION_MICRO 100
+#define LIBSWSCALE_VERSION_MICRO 101
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
diff --git a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
index 7c304706798..823056c2eac 100644
--- a/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
+++ b/chromium/third_party/ffmpeg/libswscale/x86/swscale_template.c
@@ -1499,8 +1499,8 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c)
enum AVPixelFormat dstFormat = c->dstFormat;
c->use_mmx_vfilter= 0;
- if (!is16BPS(dstFormat) && !isNBPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12
- && dstFormat != AV_PIX_FMT_NV21 && dstFormat != AV_PIX_FMT_GRAYF32BE && dstFormat != AV_PIX_FMT_GRAYF32LE
+ if (!is16BPS(dstFormat) && !isNBPS(dstFormat) && !isSemiPlanarYUV(dstFormat)
+ && dstFormat != AV_PIX_FMT_GRAYF32BE && dstFormat != AV_PIX_FMT_GRAYF32LE
&& !(c->flags & SWS_BITEXACT)) {
if (c->flags & SWS_ACCURATE_RND) {
if (!(c->flags & SWS_FULL_CHR_H_INT)) {
diff --git a/chromium/third_party/ffmpeg/tools/Makefile b/chromium/third_party/ffmpeg/tools/Makefile
index b347caf82a2..370ee354165 100644
--- a/chromium/third_party/ffmpeg/tools/Makefile
+++ b/chromium/third_party/ffmpeg/tools/Makefile
@@ -5,6 +5,9 @@ TOOLS-$(CONFIG_ZLIB) += cws2fws
tools/target_dec_%_fuzzer.o: tools/target_dec_fuzzer.c
$(COMPILE_C) -DFFMPEG_DECODER=$*
+tools/target_dem_fuzzer.o: tools/target_dem_fuzzer.c
+ $(COMPILE_C)
+
OUTDIRS += tools
clean::
diff --git a/chromium/third_party/ffmpeg/tools/crypto_bench.c b/chromium/third_party/ffmpeg/tools/crypto_bench.c
index aca8bbb1a85..0aff4ea784c 100644
--- a/chromium/third_party/ffmpeg/tools/crypto_bench.c
+++ b/chromium/third_party/ffmpeg/tools/crypto_bench.c
@@ -19,7 +19,7 @@
*/
/* Optional external libraries; can be enabled using:
- * make VERSUS=crypto+gcrypt+tomcrypt tools/crypto_bench */
+ * make VERSUS=crypto+gcrypt+tomcrypt+mbedcrypto tools/crypto_bench */
#define USE_crypto 0x01 /* OpenSSL's libcrypto */
#define USE_gcrypt 0x02 /* GnuTLS's libgcrypt */
#define USE_tomcrypt 0x04 /* LibTomCrypt */
@@ -665,8 +665,8 @@ struct hash_impl implementations[] = {
int main(int argc, char **argv)
{
- uint8_t *input = av_malloc(MAX_INPUT_SIZE * 2);
- uint8_t *output = input + MAX_INPUT_SIZE;
+ uint8_t *input;
+ uint8_t *output;
unsigned i, impl, size;
int opt;
@@ -702,12 +702,14 @@ int main(int argc, char **argv)
exit(opt != 'h');
}
}
-
+ input = av_malloc(MAX_INPUT_SIZE * 2);
if (!input)
fatal_error("out of memory");
for (i = 0; i < MAX_INPUT_SIZE; i += 4)
AV_WB32(input + i, i);
+ output = input + MAX_INPUT_SIZE;
+
size = MAX_INPUT_SIZE;
for (impl = 0; impl < FF_ARRAY_ELEMS(implementations); impl++)
run_implementation(input, output, &implementations[impl], size);
diff --git a/chromium/third_party/ffmpeg/tools/python/convert.py b/chromium/third_party/ffmpeg/tools/python/convert.py
new file mode 100644
index 00000000000..662b4290665
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/python/convert.py
@@ -0,0 +1,52 @@
+# Copyright (c) 2019 Guo Yejun
+#
+# 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
+# ==============================================================================
+
+# verified with Python 3.5.2 on Ubuntu 16.04
+import argparse
+import os
+from convert_from_tensorflow import *
+
+def get_arguments():
+ parser = argparse.ArgumentParser(description='generate native mode model with weights from deep learning model')
+ parser.add_argument('--outdir', type=str, default='./', help='where to put generated files')
+ parser.add_argument('--infmt', type=str, default='tensorflow', help='format of the deep learning model')
+ parser.add_argument('infile', help='path to the deep learning model with weights')
+
+ return parser.parse_args()
+
+def main():
+ args = get_arguments()
+
+ if not os.path.isfile(args.infile):
+ print('the specified input file %s does not exist' % args.infile)
+ exit(1)
+
+ if not os.path.exists(args.outdir):
+ print('create output directory %s' % args.outdir)
+ os.mkdir(args.outdir)
+
+ basefile = os.path.split(args.infile)[1]
+ basefile = os.path.splitext(basefile)[0]
+ outfile = os.path.join(args.outdir, basefile) + '.model'
+
+ if args.infmt == 'tensorflow':
+ convert_from_tensorflow(args.infile, outfile)
+
+if __name__ == '__main__':
+ main()
diff --git a/chromium/third_party/ffmpeg/tools/python/convert_from_tensorflow.py b/chromium/third_party/ffmpeg/tools/python/convert_from_tensorflow.py
new file mode 100644
index 00000000000..37049e58df9
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/python/convert_from_tensorflow.py
@@ -0,0 +1,201 @@
+# Copyright (c) 2019 Guo Yejun
+#
+# 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
+# ==============================================================================
+
+import tensorflow as tf
+import numpy as np
+import sys, struct
+
+__all__ = ['convert_from_tensorflow']
+
+# as the first step to be compatible with vf_sr, it is not general.
+# it will be refined step by step.
+
+class TFConverter:
+ def __init__(self, graph_def, nodes, outfile):
+ self.graph_def = graph_def
+ self.nodes = nodes
+ self.outfile = outfile
+ self.layer_number = 0
+ self.output_names = []
+ self.name_node_dict = {}
+ self.edges = {}
+ self.conv_activations = {'Relu':0, 'Tanh':1, 'Sigmoid':2, 'LeakyRelu':4}
+ self.conv_paddings = {'VALID':2, 'SAME':1}
+ self.converted_nodes = set()
+ self.op2code = {'Conv2D':1, 'DepthToSpace':2}
+
+
+ def dump_for_tensorboard(self):
+ graph = tf.get_default_graph()
+ tf.import_graph_def(self.graph_def, name="")
+ # tensorboard --logdir=/tmp/graph
+ tf.summary.FileWriter('/tmp/graph', graph)
+
+
+ def get_conv2d_params(self, node):
+ knode = self.name_node_dict[node.input[1]]
+ bnode = None
+ activation = 'None'
+ next = self.edges[node.name][0]
+ if next.op == 'BiasAdd':
+ self.converted_nodes.add(next.name)
+ bnode = self.name_node_dict[next.input[1]]
+ next = self.edges[next.name][0]
+ if next.op in self.conv_activations:
+ self.converted_nodes.add(next.name)
+ activation = next.op
+ return knode, bnode, activation
+
+
+ def dump_conv2d_to_file(self, node, f):
+ assert(node.op == 'Conv2D')
+ self.layer_number = self.layer_number + 1
+ self.converted_nodes.add(node.name)
+ knode, bnode, activation = self.get_conv2d_params(node)
+
+ dilation = node.attr['dilations'].list.i[0]
+ padding = node.attr['padding'].s
+ padding = self.conv_paddings[padding.decode("utf-8")]
+
+ ktensor = knode.attr['value'].tensor
+ filter_height = ktensor.tensor_shape.dim[0].size
+ filter_width = ktensor.tensor_shape.dim[1].size
+ in_channels = ktensor.tensor_shape.dim[2].size
+ out_channels = ktensor.tensor_shape.dim[3].size
+ kernel = np.frombuffer(ktensor.tensor_content, dtype=np.float32)
+ kernel = kernel.reshape(filter_height, filter_width, in_channels, out_channels)
+ kernel = np.transpose(kernel, [3, 0, 1, 2])
+
+ np.array([self.op2code[node.op], dilation, padding, self.conv_activations[activation], in_channels, out_channels, filter_height], dtype=np.uint32).tofile(f)
+ kernel.tofile(f)
+
+ btensor = bnode.attr['value'].tensor
+ if btensor.tensor_shape.dim[0].size == 1:
+ bias = struct.pack("f", btensor.float_val[0])
+ else:
+ bias = btensor.tensor_content
+ f.write(bias)
+
+
+ def dump_depth2space_to_file(self, node, f):
+ assert(node.op == 'DepthToSpace')
+ self.layer_number = self.layer_number + 1
+ block_size = node.attr['block_size'].i
+ np.array([self.op2code[node.op], block_size], dtype=np.uint32).tofile(f)
+ self.converted_nodes.add(node.name)
+
+
+ def generate_layer_number(self):
+ # in current hard code implementation, the layer number is the first data written to the native model file
+ # it is not easy to know it at the beginning time in the general converter, so first do a dry run for compatibility
+ # will be refined later.
+ with open('/tmp/tmp.model', 'wb') as f:
+ self.dump_layers_to_file(f)
+ self.converted_nodes.clear()
+
+
+ def dump_layers_to_file(self, f):
+ for node in self.nodes:
+ if node.name in self.converted_nodes:
+ continue
+ if node.op == 'Conv2D':
+ self.dump_conv2d_to_file(node, f)
+ elif node.op == 'DepthToSpace':
+ self.dump_depth2space_to_file(node, f)
+
+
+ def dump_to_file(self):
+ self.generate_layer_number()
+ with open(self.outfile, 'wb') as f:
+ np.array([self.layer_number], dtype=np.uint32).tofile(f)
+ self.dump_layers_to_file(f)
+
+
+ def generate_name_node_dict(self):
+ for node in self.nodes:
+ self.name_node_dict[node.name] = node
+
+
+ def generate_output_names(self):
+ used_names = []
+ for node in self.nodes:
+ for input in node.input:
+ used_names.append(input)
+
+ for node in self.nodes:
+ if node.name not in used_names:
+ self.output_names.append(node.name)
+
+
+ def remove_identity(self):
+ id_nodes = []
+ id_dict = {}
+ for node in self.nodes:
+ if node.op == 'Identity':
+ name = node.name
+ input = node.input[0]
+ id_nodes.append(node)
+ # do not change the output name
+ if name in self.output_names:
+ self.name_node_dict[input].name = name
+ self.name_node_dict[name] = self.name_node_dict[input]
+ del self.name_node_dict[input]
+ else:
+ id_dict[name] = input
+
+ for idnode in id_nodes:
+ self.nodes.remove(idnode)
+
+ for node in self.nodes:
+ for i in range(len(node.input)):
+ input = node.input[i]
+ if input in id_dict:
+ node.input[i] = id_dict[input]
+
+
+ def generate_edges(self):
+ for node in self.nodes:
+ for input in node.input:
+ if input in self.edges:
+ self.edges[input].append(node)
+ else:
+ self.edges[input] = [node]
+
+
+ def run(self):
+ self.generate_name_node_dict()
+ self.generate_output_names()
+ self.remove_identity()
+ self.generate_edges()
+
+ #check the graph with tensorboard with human eyes
+ #self.dump_for_tensorboard()
+
+ self.dump_to_file()
+
+
+def convert_from_tensorflow(infile, outfile):
+ with open(infile, 'rb') as f:
+ # read the file in .proto format
+ graph_def = tf.GraphDef()
+ graph_def.ParseFromString(f.read())
+ nodes = graph_def.node
+
+ converter = TFConverter(graph_def, nodes, outfile)
+ converter.run()
diff --git a/chromium/third_party/ffmpeg/tools/target_dec_fuzzer.c b/chromium/third_party/ffmpeg/tools/target_dec_fuzzer.c
index 2a6d525b73e..f456db0e7be 100644
--- a/chromium/third_party/ffmpeg/tools/target_dec_fuzzer.c
+++ b/chromium/third_party/ffmpeg/tools/target_dec_fuzzer.c
@@ -137,6 +137,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
const uint8_t *last = data;
const uint8_t *end = data + size;
uint32_t it = 0;
+ uint64_t ec_pixels = 0;
int (*decode_handler)(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
const AVPacket *avpkt) = NULL;
@@ -174,7 +175,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (size > 1024) {
GetByteContext gbc;
- bytestream2_init(&gbc, data + size - 1024, 1024);
+ int extradata_size;
+ size -= 1024;
+ bytestream2_init(&gbc, data + size, 1024);
ctx->width = bytestream2_get_le32(&gbc);
ctx->height = bytestream2_get_le32(&gbc);
ctx->bit_rate = bytestream2_get_le64(&gbc);
@@ -182,9 +185,18 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
// Try to initialize a parser for this codec, note, this may fail which just means we test without one
if (bytestream2_get_byte(&gbc) & 1)
parser = av_parser_init(c->id);
+
+ extradata_size = bytestream2_get_le32(&gbc);
+ if (extradata_size < size) {
+ ctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ if (ctx->extradata) {
+ ctx->extradata_size = extradata_size;
+ size -= ctx->extradata_size;
+ memcpy(ctx->extradata, data + size, ctx->extradata_size);
+ }
+ }
if (av_image_check_size(ctx->width, ctx->height, 0, ctx))
ctx->width = ctx->height = 0;
- size -= 1024;
}
int res = avcodec_open2(ctx, c, NULL);
@@ -244,7 +256,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
av_frame_unref(frame);
int ret = decode_handler(ctx, frame, &got_frame, &avpkt);
- if (it > 20)
+ ec_pixels += ctx->width * ctx->height;
+ if (it > 20 || ec_pixels > 4 * ctx->max_pixels)
ctx->error_concealment = 0;
if (ret <= 0 || ret > avpkt.size)
diff --git a/chromium/third_party/ffmpeg/tools/target_dem_fuzzer.c b/chromium/third_party/ffmpeg/tools/target_dem_fuzzer.c
new file mode 100644
index 00000000000..b51c7668781
--- /dev/null
+++ b/chromium/third_party/ffmpeg/tools/target_dem_fuzzer.c
@@ -0,0 +1,163 @@
+/*
+ * 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/avassert.h"
+
+#include "libavcodec/avcodec.h"
+#include "libavcodec/bytestream.h"
+#include "libavformat/avformat.h"
+
+
+typedef struct IOContext {
+ int64_t pos;
+ int64_t filesize;
+ uint8_t *fuzz;
+ int fuzz_size;
+} IOContext;
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+
+static void error(const char *err)
+{
+ fprintf(stderr, "%s", err);
+ exit(1);
+}
+
+static int io_read(void *opaque, uint8_t *buf, int buf_size)
+{
+ IOContext *c = opaque;
+ int size = FFMIN(buf_size, c->fuzz_size);
+
+ if (!c->fuzz_size) {
+ c->filesize = FFMIN(c->pos, c->filesize);
+ return AVERROR_EOF;
+ }
+
+ memcpy(buf, c->fuzz, size);
+ c->fuzz += size;
+ c->fuzz_size -= size;
+ c->pos += size;
+ c->filesize = FFMAX(c->filesize, c->pos);
+
+ return size;
+}
+
+static int64_t io_seek(void *opaque, int64_t offset, int whence)
+{
+ IOContext *c = opaque;
+
+ if (whence == SEEK_CUR) {
+ if (offset > INT64_MAX - c->pos)
+ return -1;
+ offset += c->pos;
+ } else if (whence == SEEK_END) {
+ if (offset > INT64_MAX - c->filesize)
+ return -1;
+ offset += c->filesize;
+ }
+ if (offset < 0 || offset > c->filesize)
+ return -1;
+ c->pos = offset;
+ return 0;
+}
+
+// Ensure we don't loop forever
+const uint32_t maxiteration = 8096;
+
+static const uint64_t FUZZ_TAG = 0x4741542D5A5A5546ULL;
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ const uint64_t fuzz_tag = FUZZ_TAG;
+ uint32_t it = 0;
+ AVFormatContext *avfmt = avformat_alloc_context();
+ AVPacket pkt;
+ char filename[1025] = {0};
+ AVIOContext *fuzzed_pb = NULL;
+ uint8_t *io_buffer;
+ int io_buffer_size = 32768;
+ int64_t filesize = size;
+ IOContext opaque;
+ static int c;
+ int seekable = 0;
+ int ret;
+
+ if (!c) {
+ av_register_all();
+ avcodec_register_all();
+ av_log_set_level(AV_LOG_PANIC);
+ c=1;
+ }
+
+ if (!avfmt)
+ error("Failed avformat_alloc_context()");
+
+ if (size > 2048) {
+ GetByteContext gbc;
+ memcpy (filename, data + size - 1024, 1024);
+ bytestream2_init(&gbc, data + size - 2048, 1024);
+ size -= 2048;
+
+ io_buffer_size = bytestream2_get_le32(&gbc) & 0xFFFFFFF;
+ seekable = bytestream2_get_byte(&gbc) & 1;
+ filesize = bytestream2_get_le64(&gbc) & 0x7FFFFFFFFFFFFFFF;
+ }
+ io_buffer = av_malloc(io_buffer_size);
+ if (!io_buffer)
+ error("Failed to allocate io_buffer");
+
+ opaque.filesize = filesize;
+ opaque.pos = 0;
+ opaque.fuzz = data;
+ opaque.fuzz_size= size;
+ fuzzed_pb = avio_alloc_context(io_buffer, io_buffer_size, 0, &opaque,
+ io_read, NULL, seekable ? io_seek : NULL);
+ if (!fuzzed_pb)
+ error("avio_alloc_context failed");
+
+ avfmt->pb = fuzzed_pb;
+
+ ret = avformat_open_input(&avfmt, filename, NULL, NULL);
+ if (ret < 0) {
+ av_freep(&fuzzed_pb->buffer);
+ av_freep(&fuzzed_pb);
+ avformat_free_context(avfmt);
+ return 0;
+ }
+
+ ret = avformat_find_stream_info(avfmt, NULL);
+ if (ret < 0)
+ goto end;
+
+ av_init_packet(&pkt);
+
+ //TODO, test seeking
+
+ for(it = 0; it < maxiteration; it++) {
+ ret = av_read_frame(avfmt, &pkt);
+ if (ret < 0)
+ break;
+ av_packet_unref(&pkt);
+ }
+end:
+ av_freep(&fuzzed_pb->buffer);
+ av_freep(&fuzzed_pb);
+ avformat_close_input(&avfmt);
+
+ return 0;
+}